usb: dwc3: Device SoftReset PHY synchonization delay
PATCH 1/15 usb: dwc3: Device SoftReset PHY synchonization delay
Hi,
Quoted 23 lines · Thinh Nguyen
From
DWC_usb31databook section 1.3.2, onceDWC3_DCTL_CSFTRSTbit is cleared, we must wait at least 50ms before accessing the PHY domain (synchronization delay).Signed-off-by Thinh Nguyen <[email protected]>--- drivers/usb/dwc3/core.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)drivers/usb/dwc3/core.c +1
-1@@ -228,12 +228,23 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)do { reg =dwc3_readl (dwc->regs,DWC3_DCTL );if (!(reg &DWC3_DCTL_CSFTRST )) -return 0 ; + goto done;udelay (1 ); }while (--retries);
drivers/usb/dwc3/core.c static int dwc3_core_soft_reset(struct dwc3 *dwc) · line 245
Quoted 10 lines
drivers/usb/dwc3/core.c +9
-0return -ETIMEDOUT ; + +done: +/* +* For DWC_usb31 controller, once DWC3_DCTL_CSFTRST bit is cleared, +* we must wait at least 50ms before accessing the PHY domain +* (synchronization delay). DWC_usb31 Databook section 1.3.2. +*/ +if (dwc3_is_usb31 (dwc)) +mdelay (50 );
we don't have any locks held. Why are you busy looping for an entire 50ms? Why don't you msleep() here?