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] [day] [month] [year] [list]
Date:   Thu, 5 Oct 2023 16:27:46 +0530
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     Liao Chang <liaochang1@...wei.com>
Cc:     rafael@...nel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq: conservative: Ensure requested_freq is greater
 than min frequency

On 12-09-23, 06:09, Liao Chang wrote:
> The governor ensures that the requested frequency is greater than the
> minimum frequency when the condition for decreasing frequency is
> satisfied. This is done by either reducing the frequency step from the
> current frequency if the current frequency is greater than the sum of
> the frequency step and the minimum frequency, or setting the frequency
> to the minimum one otherwise.
> 
> Signed-off-by: Liao Chang <liaochang1@...wei.com>
> ---
>  drivers/cpufreq/cpufreq_conservative.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
> index 56500b25d77c..54e09242b2e2 100644
> --- a/drivers/cpufreq/cpufreq_conservative.c
> +++ b/drivers/cpufreq/cpufreq_conservative.c
> @@ -130,7 +130,7 @@ static unsigned int cs_dbs_update(struct cpufreq_policy *policy)
>  		if (requested_freq == policy->min)
>  			goto out;
>  
> -		if (requested_freq > freq_step)
> +		if (requested_freq > policy->min + freq_step)
>  			requested_freq -= freq_step;
>  		else
>  			requested_freq = policy->min;

I think all we want to ensure here is that we don't end up getting a
negative number (since requested_freq is unsigned int, it will end up
being a very large freq). __cpufreq_driver_target() will eventually
set the freq to policy->min only as we are using CPUFREQ_RELATION_LE
here.

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ