lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bee03066-47b9-41d7-8c43-6170accbb7a0@nvidia.com>
Date: Tue, 6 Jan 2026 14:46:55 +0000
From: Jon Hunter <jonathanh@...dia.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
 Linux PM <linux-pm@...r.kernel.org>
Cc: linux-tegra@...r.kernel.org, Prashant Gaikwad <pgaikwad@...dia.com>,
 Michael Turquette <mturquette@...libre.com>, Stephen Boyd
 <sboyd@...nel.org>, Thierry Reding <thierry.reding@...il.com>,
 linux-clk@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
 Dmitry Osipenko <digetx@...il.com>, Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH v2] clk: tegra: Adjust callbacks in tegra_clock_pm


On 06/01/2026 12:19, Rafael J. Wysocki wrote:

...

>>> I gave this a quick test and this is causing a suspend regression on
>>> Tegra20 and Tegra30 that use this driver. Looking at the console log
>>> on Tegra20 I see the following errors ...
>>>
>>>    tegra-clock tegra_clk_sclk: PM: dpm_run_callback(): pm_runtime_resume returns 1
>>
>> Of course, it needs a wrapper.
> 
> So the patch below should work better.
> 
> ---
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Subject: [PATCH v2] clk: tegra: Adjust callbacks in tegra_clock_pm
> 
> System suspend and resume callbacks run after the core has bumped
> up the runtime PM usage counters of all devices, so these callbacks
> need not worry about runtime PM reference counting.
> 
> Accordingly, to eliminate useless overhead related to runtime PM
> usage counter manipulation, set the suspend callback pointer in
> tegra_clock_pm to a wrapper around pm_runtime_resume() called
> tegra_clock_suspend() and do not set the resume callback in it at all.
> 
> This will also 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>
> ---
> 
> v1 -> v2:
>     * Use a wrapper around pm_runtime_resume() to avoid aborting
>       system suspend when it returns 1 (which is always when the
>       clock is active during system suspend).
> 
> ---
>   drivers/clk/tegra/clk-device.c |   13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
> 
> --- a/drivers/clk/tegra/clk-device.c
> +++ b/drivers/clk/tegra/clk-device.c
> @@ -174,8 +174,19 @@ unreg_clk:
>    * problem. In practice this makes no difference from a power management
>    * perspective since voltage is kept at a nominal level during suspend anyways.
>    */
> +static inline int tegra_clock_suspend(struct device *dev)
> +{
> +	int ret;
> +
> +	ret = pm_runtime_resume(dev);
> +	if (ret < 0)
> +		return ret;
> +
> +	return 0;
> +}
> +
>   static const struct dev_pm_ops tegra_clock_pm = {
> -	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_resume_and_get, pm_runtime_put)
> +	SET_SYSTEM_SLEEP_PM_OPS(tegra_clock_suspend, NULL)
>   };
>   
>   static const struct of_device_id tegra_clock_match[] = {


Thanks. This version works for me so ...

Acked-by: Jon Hunter <jonathanh@...dia.com>
Tested-by: Jon Hunter <jonathanh@...dia.com>

Cheers
Jon

-- 
nvpublic


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ