cpufreq: interactive: always limit initial speed bump to hispeed
authorTodd Poynor <toddpoynor@google.com>
Tue, 25 Sep 2012 01:03:58 +0000 (18:03 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:52:43 +0000 (13:52 -0800)
First bump speed up to hispeed_freq whenever the current speed is below
hispeed_freq, instead of only when the current speed is the minimum speed.
The previous code made it too difficult to use hispeed_freq as a common
intermediate speed on systems that frequently run at speeds between
minimum and hispeed_freq.

Change-Id: I04ec30bafabf5741e267ff289209b8c2d846824b
Signed-off-by: Todd Poynor <toddpoynor@google.com>
drivers/cpufreq/cpufreq_interactive.c

index 4b60b6ec7ed5c3cd2a4ca8d71c0aef59cecf4618..f85fbbd6cb7b6efb87fe66bd4f3e5f801f47fc45 100644 (file)
@@ -178,7 +178,8 @@ static void cpufreq_interactive_timer(unsigned long data)
                cpu_load = load_since_change;
 
        if (cpu_load >= go_hispeed_load || boost_val) {
-               if (pcpu->target_freq <= pcpu->policy->min) {
+               if (pcpu->target_freq < hispeed_freq &&
+                   hispeed_freq < pcpu->policy->max) {
                        new_freq = hispeed_freq;
                } else {
                        new_freq = pcpu->policy->max * cpu_load / 100;