Re: [PATCH v2] phy: renesas: phy-rzg3e-usb3: Use SYSTEM_SLEEP_PM_OPS instead of NOIRQ
From: Manivannan Sadhasivam
Date: Tue Sep 08 2026 - 02:46:25 EST
On Wed, May 27, 2026 at 08:20:52AM +0000, Ovidiu Panait wrote:
> On the Renesas RZ/V2H platform, if the xhci driver is unbound and the
> system is suspended afterwards, a PM underflow error will occur:
>
> # echo 15850000.usb > /sys/bus/platform/drivers/xhci-renesas-hcd/unbind
> # systemctl suspend
> 15870000.usb-phy: PM: dpm_run_callback(): genpd_resume_noirq returns -13
> 15870000.usb-phy: PM: failed to resume noirq: error -13
> 15870000.usb-phy: Runtime PM usage count underflow!
>
> When the xhci driver is unbound, the runtime PM usage count of the PHY
> drops to 0. Since the suspend/resume callbacks are in the noirq phase,
> the pm_runtime_resume_and_get() on resume errors out with -EACCES and
> the usage count stays at 0. The subsequent put in device_complete()
> then underflows the counter.
>
> To fix this, move the suspend/resume callbacks out of the noirq phase by
> switching from NOIRQ_SYSTEM_SLEEP_PM_OPS to SYSTEM_SLEEP_PM_OPS.
>
While this patch fixes the runtime PM underflow, it does not necessarily fix the
underlying issue. The issue here is that the PHY was already suspended due to
xhci driver unbound and the pm_runtime_resume_and_get() in
rzg3e_phy_usb3_resume() unnecessarily tries to wakes up the PHY.
I think what you need is pm_runtime_force_{suspend/resume} to conditionally
resume the PHY in its rzg3e_phy_usb3_resume() callback.
- Mani
--
மணிவண்ணன் சதாசிவம்