[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <496ade71-6e77-4dea-88ca-a47322fa81c0@huawei.com>
Date: Fri, 4 Jul 2025 17:03:31 +0800
From: "zhenglifeng (A)" <zhenglifeng1@...wei.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: <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 2025/6/23 23:27, Rafael J. Wysocki wrote:
> 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?
Yes, that'll do it, too, thank you.
>
>> 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