aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/acpi-cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-03-24 02:26:43 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-04-02 09:24:00 -0400
commitb43a7ffbf33be7e4d3b10b7714ee663ea2c52fe2 (patch)
tree7d3ac2733d76a785be12bfba75bfe244a5a31460 /drivers/cpufreq/acpi-cpufreq.c
parentfd143b4d6fb763183ef6e46d1ab84a42c59079af (diff)
cpufreq: Notify all policy->cpus in cpufreq_notify_transition()
policy->cpus contains all online cpus that have single shared clock line. And their frequencies are always updated together. Many SMP system's cpufreq drivers take care of this in individual drivers but the best place for this code is in cpufreq core. This patch modifies cpufreq_notify_transition() to notify frequency change for all cpus in policy->cpus and hence updates all users of this API. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/acpi-cpufreq.c')
-rw-r--r--drivers/cpufreq/acpi-cpufreq.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 57a8774f0b4e..11b8b4b54ceb 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -423,7 +423,6 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
423 struct drv_cmd cmd; 423 struct drv_cmd cmd;
424 unsigned int next_state = 0; /* Index into freq_table */ 424 unsigned int next_state = 0; /* Index into freq_table */
425 unsigned int next_perf_state = 0; /* Index into perf table */ 425 unsigned int next_perf_state = 0; /* Index into perf table */
426 unsigned int i;
427 int result = 0; 426 int result = 0;
428 427
429 pr_debug("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu); 428 pr_debug("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu);
@@ -486,10 +485,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
486 485
487 freqs.old = perf->states[perf->state].core_frequency * 1000; 486 freqs.old = perf->states[perf->state].core_frequency * 1000;
488 freqs.new = data->freq_table[next_state].frequency; 487 freqs.new = data->freq_table[next_state].frequency;
489 for_each_cpu(i, policy->cpus) { 488 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
490 freqs.cpu = i;
491 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
492 }
493 489
494 drv_write(&cmd); 490 drv_write(&cmd);
495 491
@@ -502,10 +498,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
502 } 498 }
503 } 499 }
504 500
505 for_each_cpu(i, policy->cpus) { 501 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
506 freqs.cpu = i;
507 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
508 }
509 perf->state = next_perf_state; 502 perf->state = next_perf_state;
510 503
511out: 504out: