summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-02-01 05:42:58 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-02 01:29:31 +0100
commitb394058f064848deac7a7cd6942b6521d7b3fe1d (patch)
tree2e6272ca452cf2d116f00a561344a4672f751063 /drivers/cpufreq/cpufreq.c
parent4447266b842d27f77b017a59eb9dc38ad7b299f1 (diff)
downloadop-kernel-dev-b394058f064848deac7a7cd6942b6521d7b3fe1d.zip
op-kernel-dev-b394058f064848deac7a7cd6942b6521d7b3fe1d.tar.gz
cpufreq: governors: Reset tunables only for cpufreq_unregister_governor()
Currently, whenever governor->governor() is called for CPUFRREQ_GOV_START event we reset few tunables of governor. Which isn't correct, as this routine is called for every cpu hot-[un]plugging event. We should actually be resetting these only when the governor module is removed and re-installed. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 1cea7a1..0b4be44 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1562,6 +1562,9 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
policy->cpu, event);
ret = policy->governor->governor(policy, event);
+ if (!policy->governor->initialized && (event == CPUFREQ_GOV_START))
+ policy->governor->initialized = 1;
+
/* we keep one module reference alive for
each CPU governed by this CPU */
if ((event != CPUFREQ_GOV_START) || ret)
@@ -1585,6 +1588,7 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
mutex_lock(&cpufreq_governor_mutex);
+ governor->initialized = 0;
err = -EBUSY;
if (__find_governor(governor->name) == NULL) {
err = 0;
OpenPOWER on IntegriCloud