aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-02-07 02:21:27 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-08 19:21:13 -0500
commit8e53695f7f1d005fd1fcd3b099cd1bd73683a9f5 (patch)
tree12fea44f84d19819b8b07c1b1e8dcaf0a5952e00 /drivers/cpufreq/cpufreq.c
parent4bd4e42819c7b5b2d608b353f4d9a7717e586479 (diff)
cpufreq: governors: Fix WARN_ON() for multi-policy platforms
On multi-policy systems there is a single instance of governor for both the policies (if same governor is chosen for both policies). With the code update from following patches: 8eeed09 cpufreq: governors: Get rid of dbs_data->enable field b394058 cpufreq: governors: Reset tunables only for cpufreq_unregister_governor() We are creating/removing sysfs directory of governor for for every call to GOV_START and STOP. This would fail for multi-policy system as there is a per-policy call to START/STOP. This patch reuses the governor->initialized variable to detect total users of governor. 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0dc9933069c5..cd7644554a62 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1552,8 +1552,10 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
1552 policy->cpu, event); 1552 policy->cpu, event);
1553 ret = policy->governor->governor(policy, event); 1553 ret = policy->governor->governor(policy, event);
1554 1554
1555 if (!policy->governor->initialized && (event == CPUFREQ_GOV_START)) 1555 if (event == CPUFREQ_GOV_START)
1556 policy->governor->initialized = 1; 1556 policy->governor->initialized++;
1557 else if (event == CPUFREQ_GOV_STOP)
1558 policy->governor->initialized--;
1557 1559
1558 /* we keep one module reference alive for 1560 /* we keep one module reference alive for
1559 each CPU governed by this CPU */ 1561 each CPU governed by this CPU */