EHCI: HSIC: Halt the controller while resetting the port
commit 9ecc39cd (EHCI: HSIC: Implement new reset sequence to workaround
PHY lockup issue) does not halt controller before proceeding to reset
sequence. If the controller is not halted and SOFs are transmitted, PHY
may stuck during port reset.
CRs-Fixed: 459280
Change-Id: I213ca7d41420596b91eb9b5e6803d1e237167136
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
diff --git a/drivers/usb/host/ehci-msm-hsic.c b/drivers/usb/host/ehci-msm-hsic.c
index 8e32aa9..f1f6962 100644
--- a/drivers/usb/host/ehci-msm-hsic.c
+++ b/drivers/usb/host/ehci-msm-hsic.c
@@ -1059,6 +1059,7 @@
struct msm_hsic_hcd *mehci = hcd_to_hsic(hcd);
struct msm_hsic_host_platform_data *pdata = mehci->dev->platform_data;
u32 __iomem *status_reg = &ehci->regs->port_status[0];
+ u32 cmd;
unsigned long flags;
int retries = 0, ret, cnt = RESET_SIGNAL_TIME_USEC;
@@ -1067,6 +1068,19 @@
pdata->swfi_latency + 1);
mehci->bus_reset = 1;
+
+ /* Halt the controller */
+ cmd = ehci_readl(ehci, &ehci->regs->command);
+ cmd &= ~CMD_RUN;
+ ehci_writel(ehci, cmd, &ehci->regs->command);
+ ret = handshake(ehci, &ehci->regs->status, STS_HALT,
+ STS_HALT, 16 * 125);
+ if (ret) {
+ pr_err("halt handshake fatal error\n");
+ dbg_log_event(NULL, "HALT: fatal", 0);
+ goto fail;
+ }
+
retry:
retries++;
dbg_log_event(NULL, "RESET: start", retries);