[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hnb3q1bdsgKDL+E0QG92ju8DoEU-=Rk9cfu7Q8QEBB8Q@mail.gmail.com>
Date: Mon, 23 Jun 2025 17:27:54 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Lifeng Zheng <zhenglifeng1@...wei.com>
Cc: rafael@...nel.org, viresh.kumar@...aro.org, ionela.voinescu@....com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org, linuxarm@...wei.com,
jonathan.cameron@...wei.com, zhanjie9@...ilicon.com, lihuisong@...wei.com,
yubowen8@...wei.com
Subject: Re: [PATCH 1/7] cpufreq: Disable cpufreq-based invariance when fail
to register driver
On Mon, Jun 23, 2025 at 3:34 PM Lifeng Zheng <zhenglifeng1@...wei.com> wrote:
>
> The cpufreq-based invariance is enabled in cpufreq_register_driver(), but
> never disabled after that when fail. Add a
> static_branch_disable_cpuslocked() to do that as
> cpufreq_unregister_driver() does.
What about moving the invariance initialization to the point when 0 is
going to be returned?
> Fixes: 874f63531064 ("cpufreq: report whether cpufreq supports Frequency Invariance (FI)")
> Signed-off-by: Lifeng Zheng <zhenglifeng1@...wei.com>
> ---
> drivers/cpufreq/cpufreq.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index d7426e1d8bdd..1bc665b5bba8 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2991,6 +2991,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
> err_boost_unreg:
> remove_boost_sysfs_file();
> err_null_driver:
> + static_branch_disable_cpuslocked(&cpufreq_freq_invariance);
> write_lock_irqsave(&cpufreq_driver_lock, flags);
> cpufreq_driver = NULL;
> write_unlock_irqrestore(&cpufreq_driver_lock, flags);
> --
Powered by blists - more mailing lists