mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Gondois <pierre.gondois@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, Jie Zhan <zhanjie9@hisilicon.com>,
	Lifeng Zheng <zhenglifeng1@huawei.com>,
	Ionela Voinescu <ionela.voinescu@arm.com>,
	Sumit Gupta <sumitg@nvidia.com>,
	Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Huang Rui <ray.huang@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Perry Yuan <perry.yuan@amd.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Len Brown <lenb@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	linux-pm@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v2 2/4] cpufreq: Set default policy->min/max values for all drivers
Date: Thu, 28 May 2026 10:55:21 +0200	[thread overview]
Message-ID: <31854023-7a24-4662-9515-5459fde41aa1@arm.com> (raw)
In-Reply-To: <5jmfuo7wi4zqz3cv3voeheq6jm4xaxkwrnsprpjwewtk6v6qjs@vea3o4u7cyl4>

Hello Viresh,

On 5/22/26 07:43, Viresh Kumar wrote:
> On 11-05-26, 15:55, Pierre Gondois wrote:
>> Some drivers set policy->min/max in their .init() callback.
>> cpufreq_set_policy() will ultimately override them through:
>> cpufreq_policy_online()
>> \-cpufreq_init_policy()
>>    \-cpufreq_set_policy()
>>      \-/* Set policy->min/max */
>> Thus the policy min/max values provided are only temporary.
>>
>> There is an exception if CPUFREQ_NEED_INITIAL_FREQ_CHECK is set and:
>> cpufreq_policy_online()
>> \-__cpufreq_driver_target()
>>    \-cpufreq_driver->target()
>>
>> To prepare for a following patch that will remove all
>> policy->min/max initialization in the driver .init() callback
>> if the min/max value is equal to the cpuinfo.min/max_freq,
>> set a default policy->min/max value for all drivers.
>>
>> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
>> ---
>>   drivers/cpufreq/cpufreq.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 034603c2af325..9e2d9d3fc5351 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -1401,6 +1401,13 @@ static int cpufreq_policy_init_qos(struct cpufreq_policy *policy)
>>   {
>>   	int ret;
>>   
>> +	/*
>> +	 * If the driver didn't set policy->min/max, set them as
>> +	 * they are used to clamp frequency requests.
>> +	 */
>> +	policy->min = policy->min ? policy->min : policy->cpuinfo.min_freq;
>> +	policy->max = policy->max ? policy->max : policy->cpuinfo.max_freq;
>> +
> This has nothing to do with qos-init, we should do it along with:
>
>          cpumask_copy(policy->related_cpus, policy->cpus);
>
> in cpufreq_policy_online().
>
Ok right, I changed it in v3

  reply	other threads:[~2026-05-28  8:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 13:55 [PATCH v2 0/4] cpufreq: Set policy->min and max as real QoS constraints Pierre Gondois
2026-05-11 13:55 ` [PATCH v2 1/4] cpufreq: Extract cpufreq_policy_init_qos() function Pierre Gondois
2026-05-19 13:51   ` Zhongqiu Han
2026-05-28  8:55     ` Pierre Gondois
2026-05-20  8:10   ` Jie Zhan
2026-05-11 13:55 ` [PATCH v2 2/4] cpufreq: Set default policy->min/max values for all drivers Pierre Gondois
2026-05-20  8:12   ` Jie Zhan
2026-05-22  5:43   ` Viresh Kumar
2026-05-28  8:55     ` Pierre Gondois [this message]
2026-05-11 13:55 ` [PATCH v2 3/4] cpufreq: Remove driver default policy->min/max init Pierre Gondois
2026-05-20  8:15   ` Jie Zhan
2026-05-11 13:55 ` [PATCH v2 4/4] cpufreq: Use policy->min/max init as QoS request Pierre Gondois
2026-05-20  8:38   ` Jie Zhan
2026-05-21 11:58     ` Pierre Gondois
2026-05-25  1:05       ` Jie Zhan
2026-05-20 10:03   ` Viresh Kumar
2026-05-21 11:58     ` Pierre Gondois
2026-05-22  5:44       ` Viresh Kumar
2026-05-21 11:26   ` zhenglifeng (A)
2026-05-21 11:58     ` Pierre Gondois
2026-05-22  5:45 ` [PATCH v2 0/4] cpufreq: Set policy->min and max as real QoS constraints Viresh Kumar

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=31854023-7a24-4662-9515-5459fde41aa1@arm.com \
    --to=pierre.gondois@arm.com \
    --cc=corbet@lwn.net \
    --cc=ionela.voinescu@arm.com \
    --cc=kprateek.nayak@amd.com \
    --cc=lenb@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=saravanak@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=sumitg@nvidia.com \
    --cc=viresh.kumar@linaro.org \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.com \
    --cc=zhongqiu.han@oss.qualcomm.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®