summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorMayank Rana <mrana@codeaurora.org>2014-08-28 16:47:51 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:07:11 -0700
commit6936e3efc50a937f5cff22e9682f38a3ea09e495 (patch)
tree409e27de7a625e930ad9313ff9f8f0edf213a383 /drivers/usb
parent7b131410f5115a36e9a1ef2e3db4ecb505383b04 (diff)
dwc3: gadget: Ignore suspend event if USB speed is unknown
In some of host machine reboot usecases, it has been found that multiple suspend events are being received before usb device is being enumerated with host including receiving suspend before BUS RESET. This suspend event is being seen due to not host initiated suspend but due to LINE state at that point and may put USB Host and Device out of sync where host may not send any more BUS RESET which would cause USB device enumeration as unknown device with host machine. Fix this issue by honouring suspend event only when USB enumeration speed is known. CRs-Fixed: 717151 Change-Id: I201f106d1be71716eaa7a6246d2187889ea53a9c Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/gadget.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 3e5b4ea26b79..c6eb5043a9a2 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2752,6 +2752,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
reg = dwc3_readl(dwc->regs, DWC3_DCFG);
reg &= ~(DWC3_DCFG_DEVADDR_MASK);
dwc3_writel(dwc->regs, DWC3_DCFG, reg);
+ dwc->gadget.speed = USB_SPEED_UNKNOWN;
dwc->link_state = DWC3_LINK_STATE_U0;
wake_up_interruptible(&dwc->wait_linkstate);
}
@@ -3163,7 +3164,14 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc,
dbg_event(0xFF, "GAD SUS", 0);
dwc->dbg_gadget_events.suspend++;
- dwc3_gadget_suspend_interrupt(dwc, event->event_info);
+ /*
+ * Ignore suspend event if usb cable is not connected
+ * and speed is not being detected.
+ */
+ if (dwc->gadget.speed != USB_SPEED_UNKNOWN &&
+ dwc->vbus_active)
+ dwc3_gadget_suspend_interrupt(dwc,
+ event->event_info);
}
break;
case DWC3_DEVICE_EVENT_SOF: