From: Todd Poynor Date: Sat, 7 Apr 2012 02:50:12 +0000 (-0700) Subject: cpufreq: interactive: set at least hispeed when above hispeed load X-Git-Tag: firefly_0821_release~2958^2~311 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b2dc7eab966e0f4b175b58349d127438720c76a;p=firefly-linux-kernel-4.4.55.git cpufreq: interactive: set at least hispeed when above hispeed load If load is above go_hispeed_load, always go to at least hispeed_freq, even when reducing speed from a higher speed, not just when jumping up from minimum speed. Avoids running at a lower than intended speed after a burst of even higher load. Change-Id: I5b9d2a15ba25ce609b21bac7c724265cf6838dee Signed-off-by: Todd Poynor --- diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index e3bbe820bb01..12345c7bec28 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -166,10 +166,14 @@ static void cpufreq_interactive_timer(unsigned long data) cpu_load = load_since_change; if (cpu_load >= go_hispeed_load) { - if (pcpu->policy->cur == pcpu->policy->min) + if (pcpu->policy->cur == pcpu->policy->min) { new_freq = hispeed_freq; - else + } else { new_freq = pcpu->policy->max * cpu_load / 100; + + if (new_freq < hispeed_freq) + new_freq = hispeed_freq; + } } else { new_freq = pcpu->policy->max * cpu_load / 100; }