Re: [PATCH v2 4/4] cpufreq: Use policy->min/max init as QoS request
From: Jie Zhan
Date: Sun May 24 2026 - 21:06:08 EST
On 5/21/2026 7:58 PM, Pierre Gondois wrote:
> Hello Jie,
>
> On 5/20/26 10:38, Jie Zhan wrote:
>> On 5/11/2026 9:55 PM, Pierre Gondois wrote:
>>> Consider policy->min/max being set in the driver .init()
>>> callback as a QoS request. Impacted driver are:
>>> - gx-suspmod.c (min)
>>> - cppc-cpufreq.c (min)
>>> - longrun.c (min/max)
>>>
>>> Update the documentation accordingly.
>>>
>>> Signed-off-by: Pierre Gondois<pierre.gondois@xxxxxxx>
>>> ---
>>> Documentation/cpu-freq/cpu-drivers.rst | 10 ++++++++--
>>> drivers/cpufreq/cpufreq.c | 12 ++++++++++--
>>> 2 files changed, 18 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/Documentation/cpu-freq/cpu-drivers.rst b/Documentation/cpu-freq/cpu-drivers.rst
>>> index c5635ac3de547..ab4f3c0f3a89b 100644
>>> --- a/Documentation/cpu-freq/cpu-drivers.rst
>>> +++ b/Documentation/cpu-freq/cpu-drivers.rst
>>> @@ -114,8 +114,14 @@ Then, the driver must fill in the following values:
>>> |policy->cur | The current operating frequency of |
>>> | | this CPU (if appropriate) |
>>> +-----------------------------------+--------------------------------------+
>>> -|policy->min, | |
>>> -|policy->max, | |
>>> +|policy->min | If set by the driver in ->init(), |
>>> +| | used as initial minimum frequency |
>>> +| | QoS request. |
>>> ++-----------------------------------+--------------------------------------+
>>> +|policy->max | If set by the driver in ->init(), |
>>> +| | used as initial maximum frequency |
>>> +| | QoS request. |
>>> ++-----------------------------------+--------------------------------------+
>> Hi Pierre,
>>
>> Trivial bit: add the general meaning alongside its driver usage at the init
>> stage, and mention it defaults to cpuinfo_min/max_freq if not set?
>>
>> I mean something like:
>> The minimum/maximum scaling frequency. If set by the driver in ->init(),
>> used as initial minimum/maximum frequency QoS request; otherwise, follow
>> policy->cpuinfo.min/max_freq.
>
> Just one NIT, policy->min/max should follow the min/max allowed freq.
>
> the cpufreq driver can set. E.g. a thermal constraint can impact it (cf. dtpm_cpu.c).
>
> Would this fit ?
>
> The minimum/maximum scaling frequency. If set by the driver in ->init(),
> used as initial minimum/maximum frequency QoS request; otherwise, follow
> the min/max allowed freq. the cpufreq driver can set.
>
Sure! That's good.
>
>> Thanks,
>> Jie
>>> |policy->policy and, if necessary, | |
>>> |policy->governor | must contain the "default policy" for|
>>> | | this CPU. A few moments later, |
>> [ ... ]
>