[PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
Geert Uytterhoeven
geert at linux-m68k.org
Tue Dec 30 02:34:01 PST 2025
Hi Rafael,
On Mon, 22 Dec 2025 at 21:40, Rafael J. Wysocki <rafael at kernel.org> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
>
> The PHY core defines phy_pm_runtime_put() to return an int, but that
> return value is never used. It also passes the return value of
> pm_runtime_put() to the caller which is not very useful.
>
> Returning an error code from pm_runtime_put() merely means that it has
> not queued up a work item to check whether or not the device can be
> suspended and there are many perfectly valid situations in which that
> can happen, like after writing "on" to the devices' runtime PM "control"
> attribute in sysfs for one example.
>
> Modify phy_pm_runtime_put() to discard the pm_runtime_put() return
> value and change its return type to void. Also drop the redundant
> pm_runtime_enabled() call from there.
>
> No intentional functional impact.
>
> This will facilitate a planned change of the pm_runtime_put() return
> type to void in the future.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
Thanks for your patch, which is now commit caad07ae07e3fb17 ("phy:
core: Discard pm_runtime_put() return values") in phy/next.
This is causing several messages like
phy phy-e6590100.usb-phy-controller.2: Runtime PM usage count underflow!
during boot, and s2ram on Koelsch (R-Car M2-W).
Reverting this commit fixes the issue.
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -190,15 +190,12 @@ int phy_pm_runtime_get_sync(struct phy *
> }
> EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync);
>
> -int phy_pm_runtime_put(struct phy *phy)
> +void phy_pm_runtime_put(struct phy *phy)
> {
> if (!phy)
> - return 0;
> + return;
>
> - if (!pm_runtime_enabled(&phy->dev))
> - return -ENOTSUPP;
Adding some instrumentation shows that this branch was taken before,
thus skipping the call to pm_runtime_put().
Can I just put the check back, or is there an underlying problem that
should be fixed instead?
Thanks!
> -
> - return pm_runtime_put(&phy->dev);
> + pm_runtime_put(&phy->dev);
> }
> EXPORT_SYMBOL_GPL(phy_pm_runtime_put);
>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
More information about the linux-phy
mailing list