From: Todd Poynor Date: Fri, 4 Nov 2011 04:22:54 +0000 (-0700) Subject: cpufreq: interactive governor: scale to max only if at min speed X-Git-Tag: firefly_0821_release~7613^2~230 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eb5a34275e731c26cd15570f73796a0dc05c584a;p=firefly-linux-kernel-4.4.55.git cpufreq: interactive governor: scale to max only if at min speed Change-Id: Ieffb2aa56b5290036285c948718be7be0d3af9e8 Signed-off-by: Todd Poynor --- 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,