aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMinas Harutyunyan <hminas@synopsys.com>2018-01-16 07:03:58 -0500
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-02-12 03:59:19 -0500
commit9e95a66cce7250c358d496e1c3b62e29ce79ef40 (patch)
treec80b1cf6d35b0f9fbe8e168c46ca9f69c9ac6d11 /drivers
parent201ec568c57a43dbc73c7ac00e73c3c2d39559fc (diff)
usb: dwc2: Add safety check for STSPHSERCVD intr
STSPHSERCVD (status phase received) interrupt should be handled when EP0 is in DWC2_EP0_DATA_OUT state. Sometimes STSPHSERCVD interrupt asserted , when EP0 is not in DATA_OUT state. Spurios interrupt. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Minas Harutyunyan <hminas@synopsys.com> Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc2/gadget.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 57c7400057fa..d6222e946463 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2976,9 +2976,13 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
2976 if (ints & DXEPINT_STSPHSERCVD) { 2976 if (ints & DXEPINT_STSPHSERCVD) {
2977 dev_dbg(hsotg->dev, "%s: StsPhseRcvd\n", __func__); 2977 dev_dbg(hsotg->dev, "%s: StsPhseRcvd\n", __func__);
2978 2978
2979 /* Move to STATUS IN for DDMA */ 2979 /* Safety check EP0 state when STSPHSERCVD asserted */
2980 if (using_desc_dma(hsotg)) 2980 if (hsotg->ep0_state == DWC2_EP0_DATA_OUT) {
2981 dwc2_hsotg_ep0_zlp(hsotg, true); 2981 /* Move to STATUS IN for DDMA */
2982 if (using_desc_dma(hsotg))
2983 dwc2_hsotg_ep0_zlp(hsotg, true);
2984 }
2985
2982 } 2986 }
2983 2987
2984 if (ints & DXEPINT_BACK2BACKSETUP) 2988 if (ints & DXEPINT_BACK2BACKSETUP)