[v2] usb: dwc2: Add extra delay when forcing dr_mode
diff mbox

Message ID 205d8514e547231b928b14c4e61d12feb2e9a0c3.1455576846.git.johnyoun@synopsys.com
State New
Headers show

Commit Message

John Youn Feb. 15, 2016, 11:30 p.m. UTC
Fixes an issue found on rockchip rk3036 and rk3188 SOC platforms. For
some reason, the existing msleep(25) is not enough after the force mode.
The following patch was reported to fix the issue.

This does increase the probe delay again slightly, but not up to the
level it was before the original series of patches that this fixes. It
does not cause any other issues when tested on Synopsys HAPS and Altera
socfpga platforms.

Need to revisit this series next release to see if we can address these
issues without having an unconditional delay.

Fixes: 09c96980dc72 ("usb: dwc2: Add functions to set and clear force mode")
Reported-by: Caesar Wang <caesar.upstream@gmail.com>
Reported-by: Michael Niewoehner <linux@mniewoehner.de>
Tested-by: Caesar Wang <caesar.upstream@gmail.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
---

Hi Felipe,

This fixes a problem introduced in 4.5-rc1. Could you please queue for
the next -rc?

Thanks,
John

v2:
- Upped the delay to 50 ms for rk3188. Reported by Michael Niewoehner.


 drivers/usb/dwc2/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch
diff mbox

diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
index e991d55..46c4ba7 100644
--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -619,6 +619,12 @@  void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg)
 			 __func__, hsotg->dr_mode);
 		break;
 	}
+
+	/*
+	 * NOTE: This is required for some rockchip soc based
+	 * platforms.
+	 */
+	msleep(50);
 }
 
 /*