Re: [PATCH] cpufreq: conservative: Allow down_threshold to take values from 1 to 10

From: Viresh Kumar
Date: Sun Jun 11 2017 - 23:41:12 EST


On 11-06-17, 17:28, Tomasz WilczyÅski wrote:
> Commit 27ed3cd2ebf4cd78b198be9758c538cdede36d8a ("cpufreq: conservative:
> Fix the logic in frequency decrease checking") removed the 10 point
> substraction when comparing the load against down_threshold but did not
> remove the related limit for the down_threshold value. As a result,
> down_threshold lower than 11 is not allowed even though values from
> 1 to 10 do work correctly too. The comment ("cannot be lower than 11
> otherwise freq will not fall") is also not true after removing the
> substraction.
>
> For this reason, allow down_threshold to take any value from 1 to 99
> and fix the related comment.
>
> Signed-off-by: Tomasz WilczyÅski <twilczynski@xxxxxxxxx>

Please add Fixes tag and relevant kernel release for stable tag.

> ---
> drivers/cpufreq/cpufreq_conservative.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
> index 992f7c2..88220ff 100644
> --- a/drivers/cpufreq/cpufreq_conservative.c
> +++ b/drivers/cpufreq/cpufreq_conservative.c
> @@ -185,8 +185,8 @@ static ssize_t store_down_threshold(struct gov_attr_set *attr_set,
> int ret;
> ret = sscanf(buf, "%u", &input);
>
> - /* cannot be lower than 11 otherwise freq will not fall */
> - if (ret != 1 || input < 11 || input > 100 ||
> + /* cannot be lower than 1 otherwise freq will not fall */
> + if (ret != 1 || input < 1 || input > 100 ||
> input >= dbs_data->up_threshold)
> return -EINVAL;

Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

--
viresh