EHCI: HSIC: Fail root hub bus suspend when port is not enabled
HSIC controller can not detect HSIC device in low power mode. Hence
controller suspend is allowed only when port is enabled. But this
check is done in controller suspend routine. Controller suspend is
attempted after root hub bus is suspended. Even if we fail, controller
suspend, root hub bus remains in suspend state. This would delay
the enumeration of HSIC device as root hub bus resume takes some time.
CRs-Fixed: 396444
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
(cherry picked from commit a723f744025854c7132410fd1699bc0997617fb9)
Change-Id: I30c2117a0a6debfbc98a08610a83b56d5ac75f5b
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
diff --git a/drivers/usb/host/ehci-msm-hsic.c b/drivers/usb/host/ehci-msm-hsic.c
index 741a0b4..3f10507 100644
--- a/drivers/usb/host/ehci-msm-hsic.c
+++ b/drivers/usb/host/ehci-msm-hsic.c
@@ -659,12 +659,6 @@
return 0;
}
- if (!(readl_relaxed(USB_PORTSC) & PORT_PE)) {
- dev_dbg(mehci->dev, "%s:port is not enabled skip suspend\n",
- __func__);
- return -EAGAIN;
- }
-
disable_irq(hcd->irq);
/* make sure we don't race against a remote wakeup */
@@ -934,6 +928,15 @@
static int ehci_hsic_bus_suspend(struct usb_hcd *hcd)
{
+ struct msm_hsic_hcd *mehci = hcd_to_hsic(hcd);
+
+ if (!(readl_relaxed(USB_PORTSC) & PORT_PE)) {
+ dbg_log_event(NULL, "RH suspend attempt failed", 0);
+ dev_dbg(mehci->dev, "%s:port is not enabled skip suspend\n",
+ __func__);
+ return -EAGAIN;
+ }
+
dbg_log_event(NULL, "Suspend RH", 0);
return ehci_bus_suspend(hcd);
}