Commit ad529a9c authored by Namhyung Kim's avatar Namhyung Kim Committed by Rafael J. Wysocki

cpufreq: conservative: Break out earlier on the lowest frequency

If we're on the lowest frequency, no need to calculate new freq.
Break out even earlier in this case.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 031299b3
...@@ -87,18 +87,18 @@ static void cs_check_cpu(int cpu, unsigned int load) ...@@ -87,18 +87,18 @@ static void cs_check_cpu(int cpu, unsigned int load)
* safe, we focus 10 points under the threshold. * safe, we focus 10 points under the threshold.
*/ */
if (load < (cs_tuners->down_threshold - 10)) { if (load < (cs_tuners->down_threshold - 10)) {
freq_target = (cs_tuners->freq_step * policy->max) / 100;
dbs_info->requested_freq -= freq_target;
if (dbs_info->requested_freq < policy->min)
dbs_info->requested_freq = policy->min;
/* /*
* if we cannot reduce the frequency anymore, break out early * if we cannot reduce the frequency anymore, break out early
*/ */
if (policy->cur == policy->min) if (policy->cur == policy->min)
return; return;
freq_target = (cs_tuners->freq_step * policy->max) / 100;
dbs_info->requested_freq -= freq_target;
if (dbs_info->requested_freq < policy->min)
dbs_info->requested_freq = policy->min;
__cpufreq_driver_target(policy, dbs_info->requested_freq, __cpufreq_driver_target(policy, dbs_info->requested_freq,
CPUFREQ_RELATION_H); CPUFREQ_RELATION_H);
return; return;
......
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