aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Poynor2012-12-23 14:28:49 -0600
committerArve Hjønnevåg2013-02-19 19:56:12 -0600
commit0fb8a55e19f992cfd1bc5c241a0fb8bad791270a (patch)
treeeda3b429fbb365875fa6b5d127bf63ca49f3c4f1
parent8168cb014bf4c26ce24fba10cf6fcf360f196eaf (diff)
downloadkernel-common-0fb8a55e19f992cfd1bc5c241a0fb8bad791270a.tar.gz
kernel-common-0fb8a55e19f992cfd1bc5c241a0fb8bad791270a.tar.xz
kernel-common-0fb8a55e19f992cfd1bc5c241a0fb8bad791270a.zip
cpufreq: interactive: don't handle transition notification if not enabled
If multiple governors are in use then avoid processing frequency transition notifications for CPUs on which the interactive governor is not enabled. Change-Id: Ibd75255b921d887501a64774a8c4f62302f2d4e4 Reported-by: Francisco Franco <francisco.franco@cloudcar.com> Signed-off-by: Todd Poynor <toddpoynor@google.com>
-rw-r--r--drivers/cpufreq/cpufreq_interactive.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c
index 6b20d0024cc..286781ff9dd 100644
--- a/drivers/cpufreq/cpufreq_interactive.c
+++ b/drivers/cpufreq/cpufreq_interactive.c
@@ -551,6 +551,12 @@ static int cpufreq_interactive_notifier(
551 551
552 if (val == CPUFREQ_POSTCHANGE) { 552 if (val == CPUFREQ_POSTCHANGE) {
553 pcpu = &per_cpu(cpuinfo, freq->cpu); 553 pcpu = &per_cpu(cpuinfo, freq->cpu);
554 if (!down_read_trylock(&pcpu->enable_sem))
555 return 0;
556 if (!pcpu->governor_enabled) {
557 up_read(&pcpu->enable_sem);
558 return 0;
559 }
554 560
555 for_each_cpu(cpu, pcpu->policy->cpus) { 561 for_each_cpu(cpu, pcpu->policy->cpus) {
556 struct cpufreq_interactive_cpuinfo *pjcpu = 562 struct cpufreq_interactive_cpuinfo *pjcpu =
@@ -559,8 +565,9 @@ static int cpufreq_interactive_notifier(
559 update_load(cpu); 565 update_load(cpu);
560 spin_unlock(&pjcpu->load_lock); 566 spin_unlock(&pjcpu->load_lock);
561 } 567 }
562 }
563 568
569 up_read(&pcpu->enable_sem);
570 }
564 return 0; 571 return 0;
565} 572}
566 573