From ad529a9cd2306782907371830135a140e4572919 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Thu, 28 Feb 2013 05:38:01 +0000 Subject: [PATCH] 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: Namhyung Kim Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/cpufreq_conservative.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 6fe6050a3889..302931e76842 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -87,18 +87,18 @@ static void cs_check_cpu(int cpu, unsigned int load) * safe, we focus 10 points under the threshold. */ 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 (policy->cur == policy->min) 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_RELATION_H); return; -- GitLab