diff options
author | Todd Poynor <toddpoynor@google.com> | 2012-12-23 12:28:49 -0800 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2013-07-01 14:16:19 -0700 |
commit | bfea469069cacab4b3996f00b5389efbc8b46e95 (patch) | |
tree | 9baac24bc24879a96dc825dba6a94bdd5bbda948 /drivers/cpufreq/cpufreq_interactive.c | |
parent | 5f94a8a7b66a71c6c2a7b6f5908f841a2dd59896 (diff) |
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>
Diffstat (limited to 'drivers/cpufreq/cpufreq_interactive.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_interactive.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index c8358a3b545..51c34bf9c17 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -552,6 +552,12 @@ static int cpufreq_interactive_notifier( if (val == CPUFREQ_POSTCHANGE) { pcpu = &per_cpu(cpuinfo, freq->cpu); + if (!down_read_trylock(&pcpu->enable_sem)) + return 0; + if (!pcpu->governor_enabled) { + up_read(&pcpu->enable_sem); + return 0; + } for_each_cpu(cpu, pcpu->policy->cpus) { struct cpufreq_interactive_cpuinfo *pjcpu = @@ -560,8 +566,9 @@ static int cpufreq_interactive_notifier( update_load(cpu); spin_unlock(&pjcpu->load_lock); } - } + up_read(&pcpu->enable_sem); + } return 0; } |