Commit fa90f02d authored by Tomasz Wilczyński's avatar Tomasz Wilczyński Committed by Greg Kroah-Hartman

cpufreq: conservative: Allow down_threshold to take values from 1 to 10

commit b8e11f7d upstream.

Commit 27ed3cd2 (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") also
does not apply after removing the substraction.

For this reason, allow down_threshold to take any value from 1 to 99
and fix the related comment.

Fixes: 27ed3cd2 (cpufreq: conservative: Fix the logic in frequency decrease checking)
Signed-off-by: default avatarTomasz Wilczyński <twilczynski@naver.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 58ab7a86
...@@ -212,8 +212,8 @@ static ssize_t store_down_threshold(struct dbs_data *dbs_data, const char *buf, ...@@ -212,8 +212,8 @@ static ssize_t store_down_threshold(struct dbs_data *dbs_data, const char *buf,
int ret; int ret;
ret = sscanf(buf, "%u", &input); ret = sscanf(buf, "%u", &input);
/* cannot be lower than 11 otherwise freq will not fall */ /* cannot be lower than 1 otherwise freq will not fall */
if (ret != 1 || input < 11 || input > 100 || if (ret != 1 || input < 1 || input > 100 ||
input >= cs_tuners->up_threshold) input >= cs_tuners->up_threshold)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment