Skip to content

Commit 897e13a

Browse files
roychl666gregkh
authored andcommitted
usb: dwc3: re-enable runtime PM after failed resume
When dwc3_resume_common() returns an error, runtime pm is left in suspended and disabled state in dwc3_resume(). Since the device is suspended, its parent devices (like the power domain or glue driver) could also be suspended and may have released resources that dwc requires. Consequently, calling dwc3_suspend_common() in this situation could result in attempts to access unclocked or unpowered registers. To prevent these problems, runtime PM should always be re-enabled, even after failed resume attempts. This ensures that dwc3_suspend_common() is skipped in such cases. Fixes: 68c26fe ("usb: dwc3: set pm runtime active before resume common") Cc: [email protected] Signed-off-by: Roy Luo <[email protected]> Acked-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a6555cb commit 897e13a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/usb/dwc3/core.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,22 +2552,20 @@ static int dwc3_suspend(struct device *dev)
25522552
static int dwc3_resume(struct device *dev)
25532553
{
25542554
struct dwc3 *dwc = dev_get_drvdata(dev);
2555-
int ret;
2555+
int ret = 0;
25562556

25572557
pinctrl_pm_select_default_state(dev);
25582558

25592559
pm_runtime_disable(dev);
25602560
pm_runtime_set_active(dev);
25612561

25622562
ret = dwc3_resume_common(dwc, PMSG_RESUME);
2563-
if (ret) {
2563+
if (ret)
25642564
pm_runtime_set_suspended(dev);
2565-
return ret;
2566-
}
25672565

25682566
pm_runtime_enable(dev);
25692567

2570-
return 0;
2568+
return ret;
25712569
}
25722570

25732571
static void dwc3_complete(struct device *dev)

0 commit comments

Comments
 (0)