[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5a805200-5990-4b8c-abd7-f6f8d1481d67@kylinos.cn>
Date: Thu, 21 Aug 2025 16:17:53 +0800
From: Zihuan Zhang <zhangzihuan@...inos.cn>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "rafael J . wysocki" <rafael@...nel.org>,
zhenglifeng <zhenglifeng1@...wei.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] cpufreq: simplify cpufreq_set_policy() interface
在 2025/8/20 13:47, Viresh Kumar 写道:
> On 20-08-25, 13:42, Zihuan Zhang wrote:
>> You’re right, we didn’t really consider that case before.
>>
>> The interface of cpufreq_set_policy() does look a bit odd:
>>
>> - drivers using governors don’t really need the new_pol parameter
>>
>> - while drivers using the setpolicy method don’t need the new_gov one.
> Right, one argument is _always_ unused. If we could have handled that via a
> single argument, it would have been nice.
Sounds great.
>> I guess this might be due to some historical reasons.
>>
>> The question is whether it’s worth modifying this function, or if we should
>> just keep it as it is.
> Unless there is a better way :)
If we change cpufreq_set_policy() to only take one parameter, then we
would need to add extra fields into struct cpufreq_policy to hold
temporary values,
in order to avoid the issue where verify may return early and leave the
policy in a partially updated state.
So maybe it is better not to modify it.
>
Powered by blists - more mailing lists