Skip to content

Commit 42a6630

Browse files
Gregory Herrerogregkh
authored andcommitted
usb: dwc2: host: sleep USB_RESUME_TIMEOUT during resume
msleep(USB_RESUME_TIMEOUT) must be done when the controller drives the resume. This is true after HPRT0_RES is written. Moreover, restore the delay after controller power is up. Signed-off-by: Gregory Herrero <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b9cd825 commit 42a6630

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/dwc2/hcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,13 +1529,13 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
15291529
dev_dbg(hsotg->dev,
15301530
"ClearPortFeature USB_PORT_FEAT_SUSPEND\n");
15311531
writel(0, hsotg->regs + PCGCTL);
1532-
msleep(USB_RESUME_TIMEOUT);
1532+
usleep_range(20000, 40000);
15331533

15341534
hprt0 = dwc2_read_hprt0(hsotg);
15351535
hprt0 |= HPRT0_RES;
15361536
writel(hprt0, hsotg->regs + HPRT0);
15371537
hprt0 &= ~HPRT0_SUSP;
1538-
usleep_range(100000, 150000);
1538+
msleep(USB_RESUME_TIMEOUT);
15391539

15401540
hprt0 &= ~HPRT0_RES;
15411541
writel(hprt0, hsotg->regs + HPRT0);

0 commit comments

Comments
 (0)