mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zihuan Zhang <zhangzihuan@kylinos.cn>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J . wysocki" <rafael@kernel.org>,
	Saravana Kannan <saravanak@google.com>,
	zhenglifeng <zhenglifeng1@huawei.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 3/3] cpufreq: Make cpufreq_frequency_table_verify() internal
Date: Thu, 4 Sep 2025 13:34:01 +0800	[thread overview]
Message-ID: <cec3bcea-4c75-4869-b9b8-efd3412a1e17@kylinos.cn> (raw)
In-Reply-To: <20250904044557.tde36hekoeuhnsci@vireshk-i7>


在 2025/9/4 12:45, Viresh Kumar 写道:
> On 04-09-25, 11:22, Zihuan Zhang wrote:
>> diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c
>> index 642ddb9ea217..ee3fd1e71b90 100644
>> --- a/drivers/cpufreq/sh-cpufreq.c
>> +++ b/drivers/cpufreq/sh-cpufreq.c
>> @@ -90,10 +90,8 @@ static int sh_cpufreq_verify(struct cpufreq_policy_data *policy)
>>   {
>>   	struct clk *cpuclk = &per_cpu(sh_cpuclk, policy->cpu);
>>   
>> -	if (policy->freq_table)
>> -		return cpufreq_frequency_table_verify(policy);
>> -
>> -	cpufreq_verify_within_cpu_limits(policy);
>> +	if (!cpufreq_generic_frequency_table_verify(policy))
>> +		return 0;
>>   
>>   	policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000;
>>   	policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000;
>> diff --git a/drivers/cpufreq/virtual-cpufreq.c b/drivers/cpufreq/virtual-cpufreq.c
>> index 6ffa16d239b2..2498f40cd57e 100644
>> --- a/drivers/cpufreq/virtual-cpufreq.c
>> +++ b/drivers/cpufreq/virtual-cpufreq.c
>> @@ -249,10 +249,7 @@ static int virt_cpufreq_offline(struct cpufreq_policy *policy)
>>   
>>   static int virt_cpufreq_verify_policy(struct cpufreq_policy_data *policy)
>>   {
>> -	if (policy->freq_table)
>> -		return cpufreq_frequency_table_verify(policy);
>> -
>> -	cpufreq_verify_within_cpu_limits(policy);
>> +	cpufreq_generic_frequency_table_verify(policy);
>>   	return 0;
>>   }
> You ended up changing the logic of both these files and it isn't the
> same anymore. Earlier if freq_table was there and
> cpufreq_frequency_table_verify() failed, we used to return, but not
> anymore.
>
> And we don't return the error anymore for virtual driver.


Thanks for pointing this out, Viresh.

You are correct — with the current changes, if
cpufreq_generic_frequency_table_verify() fails, we no longer return
an error in these drivers. For drivers that lack a frequency table,
they can still operate, which is why I wasn’t sure whether returning
an error is strictly necessary.

I would appreciate your advice here: should we preserve the old
behavior and return an error on failure, or is it acceptable for
drivers without a table to continue without it?


>

  reply	other threads:[~2025-09-04  5:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04  3:22 [PATCH v1 0/3] cpufreq: Clean up frequency table handling Zihuan Zhang
2025-09-04  3:22 ` [PATCH v1 1/3] cpufreq: Drop redundant freq_table parameter Zihuan Zhang
2025-09-04 13:31   ` Rafael J. Wysocki
2025-09-05  1:16     ` Zihuan Zhang
2025-09-04  3:22 ` [PATCH v1 2/3] cpufreq: Always enforce policy limits even without frequency table Zihuan Zhang
2025-09-04  4:48   ` Viresh Kumar
2025-09-04  5:23     ` Zihuan Zhang
2025-09-04  5:37       ` Viresh Kumar
2025-09-04  5:48         ` Zihuan Zhang
2025-09-08  6:13           ` Viresh Kumar
2025-09-08  6:51             ` Zihuan Zhang
2025-09-08  6:55               ` Viresh Kumar
2025-09-08  7:08                 ` Zihuan Zhang
2025-09-08  7:19                   ` Viresh Kumar
2025-09-08  7:36                     ` Zihuan Zhang
2025-09-08  7:44                       ` Viresh Kumar
2025-09-04  3:22 ` [PATCH v1 3/3] cpufreq: Make cpufreq_frequency_table_verify() internal Zihuan Zhang
2025-09-04  4:45   ` Viresh Kumar
2025-09-04  5:34     ` Zihuan Zhang [this message]
2025-09-08  6:46       ` Viresh Kumar
2025-09-04  4:24 ` [PATCH v1 0/3] cpufreq: Clean up frequency table handling Viresh Kumar
2025-09-04  4:36   ` Zihuan Zhang

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=cec3bcea-4c75-4869-b9b8-efd3412a1e17@kylinos.cn \
    --to=zhangzihuan@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=saravanak@google.com \
    --cc=viresh.kumar@linaro.org \
    --cc=zhenglifeng1@huawei.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®