diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-02-28 00:38:01 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-31 19:11:35 -0400 |
commit | ad529a9cd2306782907371830135a140e4572919 (patch) | |
tree | 43f38f483bf9638cf2249812b9401ea268cb7b4e /drivers | |
parent | 031299b3be30f3ecab110fff8faad85af70e1797 (diff) |
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 <namhyung@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 12 |
1 files 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) | |||
87 | * safe, we focus 10 points under the threshold. | 87 | * safe, we focus 10 points under the threshold. |
88 | */ | 88 | */ |
89 | if (load < (cs_tuners->down_threshold - 10)) { | 89 | if (load < (cs_tuners->down_threshold - 10)) { |
90 | freq_target = (cs_tuners->freq_step * policy->max) / 100; | ||
91 | |||
92 | dbs_info->requested_freq -= freq_target; | ||
93 | if (dbs_info->requested_freq < policy->min) | ||
94 | dbs_info->requested_freq = policy->min; | ||
95 | |||
96 | /* | 90 | /* |
97 | * if we cannot reduce the frequency anymore, break out early | 91 | * if we cannot reduce the frequency anymore, break out early |
98 | */ | 92 | */ |
99 | if (policy->cur == policy->min) | 93 | if (policy->cur == policy->min) |
100 | return; | 94 | return; |
101 | 95 | ||
96 | freq_target = (cs_tuners->freq_step * policy->max) / 100; | ||
97 | |||
98 | dbs_info->requested_freq -= freq_target; | ||
99 | if (dbs_info->requested_freq < policy->min) | ||
100 | dbs_info->requested_freq = policy->min; | ||
101 | |||
102 | __cpufreq_driver_target(policy, dbs_info->requested_freq, | 102 | __cpufreq_driver_target(policy, dbs_info->requested_freq, |
103 | CPUFREQ_RELATION_H); | 103 | CPUFREQ_RELATION_H); |
104 | return; | 104 | return; |