lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ffe2344d-e825-44c0-ad2b-9544b123079f@kylinos.cn>
Date: Wed, 20 Aug 2025 13:42:20 +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/19 18:59, Viresh Kumar 写道:
> On 19-08-25, 18:39, Zihuan Zhang wrote:
>>   static int cpufreq_set_policy(struct cpufreq_policy *policy,
>> -			      struct cpufreq_governor *new_gov,
>> -			      unsigned int new_pol);
>> +			      struct cpufreq_governor *new_gov);
> A driver will either support the policy or the governor. If we are
> keeping `new_gov` around, I don't see why `new_pol` should be dropped.

Thanks for the reminder.

If we remove new_pol, then new_gov should indeed be removed as well.

> And changing the policy for a `setpolicy` driver should happen from
> within cpufreq_set_policy() instead of the caller. Also there is at
> least one case (verify()) where we may end up returning early, before
> changing the policy.
>
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.


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.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ