[PATCH] phy: core: Reinstate pm_runtime_enabled() check in phy_pm_runtime_put()
Wysocki, Rafael J
rafael.j.wysocki at intel.com
Tue Dec 30 09:10:28 PST 2025
On 12/30/2025 4:04 PM, Geert Uytterhoeven wrote:
> On Koelsch (R-Car M2-W), during boot and s2ram:
>
> phy phy-e6590100.usb-phy-controller.0: Runtime PM usage count underflow!
>
> While phy_pm_runtime_get{,_sync}() and phy_pm_runtime_put_sync() still
> contain pm_runtime_enabled() checks, the same check in
> phy_pm_runtime_put() was deemed redundant and removed, causing count
> underflows with PHY drivers like drivers/phy/renesas/phy-rcar-gen2.c
> that do not use Runtime PM yet,
>
> Fix this by reinstating the check.
>
> Fixes: caad07ae07e3fb17 ("phy: core: Discard pm_runtime_put() return values")
> Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
> ---
> drivers/phy/phy-core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 160ecb757d1d62a0..e2a2a99d069789c7 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -195,6 +195,9 @@ void phy_pm_runtime_put(struct phy *phy)
> if (!phy)
> return;
>
> + if (!pm_runtime_enabled(&phy->dev))
> + return;
> +
> pm_runtime_put(&phy->dev);
> }
> EXPORT_SYMBOL_GPL(phy_pm_runtime_put);
More information about the linux-phy
mailing list