mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "zhenglifeng (A)" <zhenglifeng1@huawei.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: <viresh.kumar@linaro.org>, <ionela.voinescu@arm.com>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	<linuxarm@huawei.com>, <jonathan.cameron@huawei.com>,
	<zhanjie9@hisilicon.com>, <lihuisong@huawei.com>,
	<yubowen8@huawei.com>
Subject: Re: [PATCH 1/7] cpufreq: Disable cpufreq-based invariance when fail to register driver
Date: Fri, 4 Jul 2025 17:03:31 +0800	[thread overview]
Message-ID: <496ade71-6e77-4dea-88ca-a47322fa81c0@huawei.com> (raw)
In-Reply-To: <CAJZ5v0hnb3q1bdsgKDL+E0QG92ju8DoEU-=Rk9cfu7Q8QEBB8Q@mail.gmail.com>

On 2025/6/23 23:27, Rafael J. Wysocki wrote:

> On Mon, Jun 23, 2025 at 3:34 PM Lifeng Zheng <zhenglifeng1@huawei.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@huawei.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);
>> --


  reply	other threads:[~2025-07-04  9:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 13:33 [PATCH 0/7] cpufreq: Some optimizations for cpufreq.c Lifeng Zheng
2025-06-23 13:33 ` [PATCH 1/7] cpufreq: Disable cpufreq-based invariance when fail to register driver Lifeng Zheng
2025-06-23 15:27   ` Rafael J. Wysocki
2025-07-04  9:03     ` zhenglifeng (A) [this message]
2025-06-23 13:33 ` [PATCH 2/7] cpufreq: Init policy->rwsem before it may be possibly used Lifeng Zheng
2025-06-23 15:29   ` Rafael J. Wysocki
2025-07-04  9:04     ` zhenglifeng (A)
2025-06-23 13:33 ` [PATCH 3/7] cpufreq: Contain scaling_cur_freq.attr in cpufreq_attrs Lifeng Zheng
2025-06-23 15:30   ` Rafael J. Wysocki
2025-07-03 14:59     ` Rafael J. Wysocki
2025-07-04  9:07       ` zhenglifeng (A)
2025-06-23 13:33 ` [PATCH 4/7] cpufreq: Remove duplicate check in __cpufreq_offline() Lifeng Zheng
2025-06-23 15:31   ` Rafael J. Wysocki
2025-06-23 13:34 ` [PATCH 5/7] cpufreq: Move the check of cpufreq_driver->get into cpufreq_verify_current_freq() Lifeng Zheng
2025-06-23 15:35   ` Rafael J. Wysocki
2025-07-04  9:16     ` zhenglifeng (A)
2025-06-23 13:34 ` [PATCH 6/7] cpufreq: Refactor code about starting governor in cpufreq_set_policy() Lifeng Zheng
2025-06-23 15:13   ` Rafael J. Wysocki
2025-07-04  9:37     ` zhenglifeng (A)
2025-06-23 13:34 ` [PATCH 7/7] cpufreq: Exit governor when failed to start old governor Lifeng Zheng
2025-06-23 15:12   ` Rafael J. Wysocki
2025-07-04  9:38     ` zhenglifeng (A)
2025-07-04  9:48       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496ade71-6e77-4dea-88ca-a47322fa81c0@huawei.com \
    --to=zhenglifeng1@huawei.com \
    --cc=ionela.voinescu@arm.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=yubowen8@huawei.com \
    --cc=zhanjie9@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®