EHCI: HSIC: Set Run/Stop bit before driving resume on to the bus
In case of remote wake up there is a possibility that device
does not receive SOF on to the bus within 3ms after host finishing
the resume signaling, which causes device controller to go back to
suspend. Hence set the run stop bit before driving resume onto the
bus to avoid this situation as device would see SOF as soon as host
finishes the resume signaling.
CRs-Fixed: 368212
Change-Id: I90fabfe15fa26e7b7832bd82823b5e2eba0b2357
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
diff --git a/drivers/usb/host/ehci-msm-hsic.c b/drivers/usb/host/ehci-msm-hsic.c
index 6bd0577..5ed16cc 100644
--- a/drivers/usb/host/ehci-msm-hsic.c
+++ b/drivers/usb/host/ehci-msm-hsic.c
@@ -690,6 +690,13 @@
skip_phy_resume:
+ if (!(readl_relaxed(USB_USBCMD) & CMD_RUN) &&
+ (readl_relaxed(USB_PORTSC) & PORT_SUSPEND)) {
+ writel_relaxed(readl_relaxed(USB_USBCMD) | CMD_RUN ,
+ USB_USBCMD);
+ dbg_log_event(NULL, "Set RS", readl_relaxed(USB_USBCMD));
+ }
+
usb_hcd_resume_root_hub(hcd);
atomic_set(&mehci->in_lpm, 0);