mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, rafael@kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: check only freq_table in __resolve_freq()
Date: Tue, 16 Aug 2022 11:16:29 +0100	[thread overview]
Message-ID: <04a18937-bb11-736f-2cb3-0cb76a25bcc7@arm.com> (raw)
In-Reply-To: <20220812040545.gcmyjjpqfup3bo5u@vireshk-i7>



On 8/12/22 05:05, Viresh Kumar wrote:
> On 11-08-22, 17:54, Lukasz Luba wrote:
>> The there is no need to check if the cpufreq driver implements callback
> 
> s/The there/There/
> 
>> cpufreq_driver::target_index. The logic in the __resolve_freq uses
>> the frequency table available in the policy. It doesn't matter if the
>> driver provides 'target_index' or 'target' callback. It just has to
>> populate the 'policy->freq_table'.
>>
>> Thus, check only frequency table during the frequency resolving call.
>>
>> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
>> ---
>>   drivers/cpufreq/cpufreq.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 7820c4e74289..69b3d61852ac 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -532,7 +532,7 @@ static unsigned int __resolve_freq(struct cpufreq_policy *policy,
>>   
>>   	target_freq = clamp_val(target_freq, policy->min, policy->max);
>>   
>> -	if (!cpufreq_driver->target_index)
>> +	if (!policy->freq_table)
>>   		return target_freq;
>>   
>>   	idx = cpufreq_frequency_table_target(policy, target_freq, relation);
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 

Thanks Viresh! I'll resend this patch w/ fixed description and your ACK

      reply	other threads:[~2022-08-16 11:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 16:54 Lukasz Luba
2022-08-12  4:05 ` Viresh Kumar
2022-08-16 10:16   ` Lukasz Luba [this message]

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=04a18937-bb11-736f-2cb3-0cb76a25bcc7@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /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®