summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/dwc3/gadget.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 0dceef917c8e..ca8cedf1261b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2829,9 +2829,14 @@ static void dwc3_gadget_suspend_interrupt(struct dwc3 *dwc,
* DWC3_DEVICE_EVENT_RESET or DWC3_DEVICE_EVENT_CONNECT_DONE
* events, the controller sees a DWC3_DEVICE_EVENT_SUSPEND
* event. In such a case, ignore.
+ * Ignore suspend event until device side usb is not into
+ * CONFIGURED state.
*/
- if (dwc->gadget.state == USB_STATE_NOTATTACHED)
+ if (dwc->gadget.state != USB_STATE_CONFIGURED) {
+ pr_err("%s(): state:%d. Ignore SUSPEND.\n",
+ __func__, dwc->gadget.state);
return;
+ }
dwc3_suspend_gadget(dwc);
}