summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMayank Rana <mrana@codeaurora.org>2014-08-29 14:36:05 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:06:48 -0700
commit2991c5cf8cb462971b7eee0d7197aacb8a154451 (patch)
treebb0ed7a03f1023904cb24f272f8abde22dd5efdc /drivers
parentb371a833e6c31ff4c2e56d8e68a2258f87860765 (diff)
dwc3: gadget: Ignore suspend event if USB is not into CONFIGURED state
For reboot usecase with some of host machine, it has been observed that Suspend event is being received in between USB enumeration process which is highly unlikely case. Although due to this event, device side USB goes into suspend state which cause USB device enumerates as unknown device with host machine. Fix this issue by ignoring suspend event until USB enumeration process is not being completed i.e. device side USB is not reach into CONFIGURED state. Add check for CONFIGURED state with controller suspend routine as well to make sure that if this routine finds controller into L2 state before it performs LPM functionality, it confirms that state of USB as CONFIGURED. CRs-Fixed: 717151 Change-Id: I86925f22edf94c526a3b7504333501b6e27412d7 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Diffstat (limited to 'drivers')
-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);
}