* [PATCH] usb: core: hcd: Skip PHY rollback on failed autoresume
@ 2026-11-06 9:28 Cunhao Lu via B4 Relay
2026-11-06 9:48 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Cunhao Lu via B4 Relay @ 2026-11-06 9:28 UTC (permalink / raw)
To: Greg Kroah-Hartman, Alan Stern, Martin Blumenstingl, Chunfeng Yun
Cc: linux-usb, linux-kernel, stable, Cunhao Lu
From: Cunhao Lu <1579567540@qq.com>
hcd_bus_resume() resumes the root-hub PHYs only for non-automatic PM
events, but its failure path suspends them unconditionally.
A failed autoresume therefore drops PHY power references without a
matching acquisition. If wakeup is disabled for the controller, it can
also drop PHY initialization references. Subsequent cleanup can then
report unbalanced regulator disables.
Guard the failure-path PHY suspend with !PMSG_IS_AUTO(msg), matching
the condition used for PHY resume.
Fixes: 178a0bce05cb ("usb: core: hcd: integrate the PHY wrapper into the HCD core")
Cc: stable@vger.kernel.org
Signed-off-by: Cunhao Lu <1579567540@qq.com>
---
This USB core issue was found during the RK3572 mainlining work.
hcd_bus_resume() resumes the root-hub PHYs only for system PM, but its
failure path suspends them even for an automatic resume. This releases
PHY power references without a matching acquisition and, depending on
the wakeup policy, can also drop initialization references. Subsequent
cleanup can then produce unbalanced regulator-disable warnings.
This patch guards the failure-path PHY suspend with the same
!PMSG_IS_AUTO(msg) condition as the PHY resume. This preserves the PHY
references when an automatic resume fails and retains the existing
system-PM rollback.
Validation:
- Hardware testing on the Forlinx OK3572-C reproduced native xHCI
Run/Stop timeouts in two USB2-only configurations. With the fix,
eleven failed automatic resumes returned -ESHUTDOWN. Tracing showed
unchanged PHY initialization and power counts across each call, no
extra PHY suspend, power-off or exit calls, and no regulator warnings.
No trace events were lost or probes missed.
---
drivers/usb/core/hcd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 8e8a5f59b319b..fc4c28b7d4398 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2368,7 +2368,9 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg)
}
} else {
hcd->state = old_state;
- usb_phy_roothub_suspend(hcd->self.sysdev, hcd->phy_roothub);
+ if (!PMSG_IS_AUTO(msg))
+ usb_phy_roothub_suspend(hcd->self.sysdev,
+ hcd->phy_roothub);
dev_dbg(&rhdev->dev, "bus %s fail, err %d\n",
"resume", status);
if (status != -ESHUTDOWN)
---
base-commit: a804c5742bff224d4cb4d25dd383554d598be32b
change-id: 20261106-fix-usb-hcd-autoresume-phy-rollback-e9e7e2b53667
Best regards,
--
Cunhao Lu <1579567540@qq.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: core: hcd: Skip PHY rollback on failed autoresume
2026-11-06 9:28 [PATCH] usb: core: hcd: Skip PHY rollback on failed autoresume Cunhao Lu via B4 Relay
@ 2026-11-06 9:48 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-06 9:48 UTC (permalink / raw)
To: Cunhao Lu; +Cc: linux-usb
> From: Cunhao Lu <1579567540@qq.com>
>
> hcd_bus_resume() resumes the root-hub PHYs only for non-automatic PM
> events, but its failure path suspends them unconditionally.
>
> A failed autoresume therefore drops PHY power references without a
> matching acquisition. If wakeup is disabled for the controller, it can
> also drop PHY initialization references. Subsequent cleanup can then
> report unbalanced regulator disables.
>
> Guard the failure-path PHY suspend with !PMSG_IS_AUTO(msg), matching
> the condition used for PHY resume.
>
> Fixes: 178a0bce05cb ("usb: core: hcd: integrate the PHY wrapper into the HCD core")
> Cc: stable@vger.kernel.org
> Signed-off-by: Cunhao Lu <1579567540@qq.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106-fix-usb-hcd-autoresume-phy-rollback-v1-1-1ed900ddcd2d@qq.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-06 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 9:28 [PATCH] usb: core: hcd: Skip PHY rollback on failed autoresume Cunhao Lu via B4 Relay
2026-11-06 9:48 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox