diff options
author | Todd Poynor <toddpoynor@google.com> | 2011-11-03 21:22:54 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:39:17 -0800 |
commit | cf9f9c59cf46c60fe41712a057b70f754c46cca6 (patch) | |
tree | 09d9dec1421db4272167bf95e758a3e69134f2eb /drivers | |
parent | c50272ac294c648c23e9b90054f93efac8da5544 (diff) |
cpufreq: interactive governor: scale to max only if at min speed
Change-Id: Ieffb2aa56b5290036285c948718be7be0d3af9e8
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq_interactive.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index a085fc86733b..72ae6533a2d4 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -159,10 +159,14 @@ static void cpufreq_interactive_timer(unsigned long data) if (load_since_change > cpu_load) cpu_load = load_since_change; - if (cpu_load >= go_maxspeed_load) - new_freq = pcpu->policy->max; - else + if (cpu_load >= go_maxspeed_load) { + if (pcpu->policy->cur == pcpu->policy->min) + new_freq = pcpu->policy->max; + else + new_freq = pcpu->policy->max * cpu_load / 100; + } else { new_freq = pcpu->policy->cur * cpu_load / 100; + } if (cpufreq_frequency_table_target(pcpu->policy, pcpu->freq_table, new_freq, CPUFREQ_RELATION_H, |