[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVMFQebA43FJ53PBnd67C8fxWAC21cr4jWTGDwg-HV53w@mail.gmail.com>
Date: Tue, 30 Dec 2025 11:34:01 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Linux PM <linux-pm@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Ulf Hansson <ulf.hansson@...aro.org>, Brian Norris <briannorris@...omium.org>,
Vinod Koul <vkoul@...nel.org>, Neil Armstrong <neil.armstrong@...aro.org>,
linux-phy@...ts.infradead.org,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH v1 15/23] phy: core: Discard pm_runtime_put() return values
Hi Rafael,
On Mon, 22 Dec 2025 at 21:40, Rafael J. Wysocki <rafael@...nel.org> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.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@...el.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@...ux-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
Powered by blists - more mailing lists