Skip to content

Commit 68c26fe

Browse files
Frank Wanggregkh
authored andcommitted
usb: dwc3: set pm runtime active before resume common
For device mode, if PM runtime autosuspend feature enabled, the runtime power status of dwc3 may be suspended when run dwc3_resume(), and dwc3 gadget would not be configured in dwc3_gadget_run_stop(). It would cause gadget connected failed if USB cable has been plugged before PM resume. So move forward pm_runtime_set_active() to fix it. Signed-off-by: Frank Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 398aa9a commit 68c26fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/usb/dwc3/core.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,12 +2315,15 @@ static int dwc3_resume(struct device *dev)
23152315

23162316
pinctrl_pm_select_default_state(dev);
23172317

2318+
pm_runtime_disable(dev);
2319+
pm_runtime_set_active(dev);
2320+
23182321
ret = dwc3_resume_common(dwc, PMSG_RESUME);
2319-
if (ret)
2322+
if (ret) {
2323+
pm_runtime_set_suspended(dev);
23202324
return ret;
2325+
}
23212326

2322-
pm_runtime_disable(dev);
2323-
pm_runtime_set_active(dev);
23242327
pm_runtime_enable(dev);
23252328

23262329
return 0;

0 commit comments

Comments
 (0)