]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Call __cpufreq_governor() with correct policy->cpus mask
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 11 Apr 2013 08:04:53 +0000 (08:04 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 11 Apr 2013 20:50:09 +0000 (22:50 +0200)
commit96b97e6e8e6359e9f1daa2c90aa7dfb19dd28c88
treea3ed54f86c50628e08eba962d2a137d9c2871976
parent0055ccf3a63cd0a9eb7b5d08e70f4cab84d2f05b
cpufreq: Call __cpufreq_governor() with correct policy->cpus mask

__cpufreq_governor() must be called with a correct policy->cpus mask.
In __cpufreq_remove_dev() we initially clear policy->cpus with
cpumask_clear_cpu() and then call
__cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT). If the governor
is doing some per-cpu stuff in EXIT callback, this can create
uncertain behavior.

Generic governors in drivers/cpufreq/ doesn't do any per-cpu stuff
in EXIT callback and so we don't face any issues currently. But its
better to keep the code clean, so we don't face any issues in future.

Now, we call cpumask_clear_cpu() only when multiple cpus are managed
by policy.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c