Skip to content

Commit f4fd84a

Browse files
Thinh Nguyengregkh
authored andcommitted
usb: dwc3: core: Only handle soft-reset in DCTL
Make sure not to set run_stop bit or link state change request while initiating soft-reset. Register read-modify-write operation may unintentionally start the controller before the initialization completes with its previous DCTL value, which can cause initialization failure. Fixes: f59dcab ("usb: dwc3: core: improve reset sequence") Cc: <[email protected]> Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/6aecbd78328f102003d40ccf18ceeebd411d3703.1650594792.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bf95c4d commit f4fd84a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/dwc3/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ int dwc3_core_soft_reset(struct dwc3 *dwc)
274274

275275
reg = dwc3_readl(dwc->regs, DWC3_DCTL);
276276
reg |= DWC3_DCTL_CSFTRST;
277-
dwc3_writel(dwc->regs, DWC3_DCTL, reg);
277+
reg &= ~DWC3_DCTL_RUN_STOP;
278+
dwc3_gadget_dctl_write_safe(dwc, reg);
278279

279280
/*
280281
* For DWC_usb31 controller 1.90a and later, the DCTL.CSFRST bit

0 commit comments

Comments
 (0)