aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_stats.c
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2013-07-29 18:53:56 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-07 17:02:48 -0400
commit23d328994b548d6822b88fe7e1903652afc354e0 (patch)
treed2eb8f99ce3d27a1719d8cc86b1802ba85645793 /drivers/cpufreq/cpufreq_stats.c
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f (diff)
cpufreq: Fix misplaced call to cpufreq_update_policy()
The call to cpufreq_update_policy() is placed in the CPU hotplug callback of cpufreq_stats, which has a higher priority than the CPU hotplug callback of cpufreq-core. As a result, during CPU_ONLINE/CPU_ONLINE_FROZEN, we end up calling cpufreq_update_policy() *before* calling cpufreq_add_dev() ! And for uninitialized CPUs, it just returns silently, not doing anything. To add to that, cpufreq_stats is not even the right place to call cpufreq_update_policy() to begin with. The cpufreq core ought to handle this in its own callback, from an elegance/relevance perspective. So move the invocation of cpufreq_update_policy() to cpufreq_cpu_callback, and place it *after* cpufreq_add_dev(). Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_stats.c')
-rw-r--r--drivers/cpufreq/cpufreq_stats.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index d37568c5ca9c..bc73be225be5 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -348,10 +348,6 @@ static int cpufreq_stat_cpu_callback(struct notifier_block *nfb,
348 unsigned int cpu = (unsigned long)hcpu; 348 unsigned int cpu = (unsigned long)hcpu;
349 349
350 switch (action) { 350 switch (action) {
351 case CPU_ONLINE:
352 case CPU_ONLINE_FROZEN:
353 cpufreq_update_policy(cpu);
354 break;
355 case CPU_DOWN_PREPARE: 351 case CPU_DOWN_PREPARE:
356 case CPU_DOWN_PREPARE_FROZEN: 352 case CPU_DOWN_PREPARE_FROZEN:
357 cpufreq_stats_free_sysfs(cpu); 353 cpufreq_stats_free_sysfs(cpu);
@@ -390,8 +386,6 @@ static int __init cpufreq_stats_init(void)
390 return ret; 386 return ret;
391 387
392 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier); 388 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
393 for_each_online_cpu(cpu)
394 cpufreq_update_policy(cpu);
395 389
396 ret = cpufreq_register_notifier(&notifier_trans_block, 390 ret = cpufreq_register_notifier(&notifier_trans_block,
397 CPUFREQ_TRANSITION_NOTIFIER); 391 CPUFREQ_TRANSITION_NOTIFIER);