[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250401084625.345sbknbhslzagzu@vireshk-i7>
Date: Tue, 1 Apr 2025 14:16:25 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Linux PM <linux-pm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Mario Limonciello <mario.limonciello@....com>,
Sudeep Holla <sudeep.holla@....com>
Subject: Re: [PATCH v1 06/10] cpufreq: Use locking guard and __free() in
cpufreq_update_policy()
On 28-03-25, 21:44, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Instead of using cpufreq_cpu_acquire() and cpufreq_cpu_release() in
> cpufreq_update_policy(), which is the last user of these functions,
> make it use __free() for policy reference counting cleanup and the
> "write" locking guard for policy locking.
>
> No intentional functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> drivers/cpufreq/cpufreq.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2752,23 +2752,23 @@
> */
> void cpufreq_update_policy(unsigned int cpu)
> {
> - struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpu);
> + struct cpufreq_policy *policy __free(put_cpufreq_policy);
>
> + policy = cpufreq_cpu_get(cpu);
> if (!policy)
> return;
>
> + guard(cpufreq_policy_write)(policy);
> +
> /*
> * BIOS might change freq behind our back
> * -> ask driver for current freq and notify governors about a change
> */
> if (cpufreq_driver->get && has_target() &&
> (cpufreq_suspended || WARN_ON(!cpufreq_verify_current_freq(policy, false))))
> - goto unlock;
> + return;
>
> refresh_frequency_limits(policy);
> -
> -unlock:
> - cpufreq_cpu_release(policy);
Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
--
viresh
Powered by blists - more mailing lists