aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/us2e_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 /arch/sparc/kernel/us2e_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 'arch/sparc/kernel/us2e_cpufreq.c')
-rw-r--r--arch/sparc/kernel/us2e_cpufreq.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/sparc/kernel/us2e_cpufreq.c b/arch/sparc/kernel/us2e_cpufreq.c
index 489fc15f3194..abe963d7b87c 100644
--- a/arch/sparc/kernel/us2e_cpufreq.c
+++ b/arch/sparc/kernel/us2e_cpufreq.c
@@ -248,8 +248,10 @@ static unsigned int us2e_freq_get(unsigned int cpu)
248 return clock_tick / estar_to_divisor(estar); 248 return clock_tick / estar_to_divisor(estar);
249} 249}
250 250
251static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) 251static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy,
252 unsigned int index)
252{ 253{
254 unsigned int cpu = policy->cpu;
253 unsigned long new_bits, new_freq; 255 unsigned long new_bits, new_freq;
254 unsigned long clock_tick, divisor, old_divisor, estar; 256 unsigned long clock_tick, divisor, old_divisor, estar;
255 cpumask_t cpus_allowed; 257 cpumask_t cpus_allowed;
@@ -272,14 +274,13 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
272 274
273 freqs.old = clock_tick / old_divisor; 275 freqs.old = clock_tick / old_divisor;
274 freqs.new = new_freq; 276 freqs.new = new_freq;
275 freqs.cpu = cpu; 277 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
276 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
277 278
278 if (old_divisor != divisor) 279 if (old_divisor != divisor)
279 us2e_transition(estar, new_bits, clock_tick * 1000, 280 us2e_transition(estar, new_bits, clock_tick * 1000,
280 old_divisor, divisor); 281 old_divisor, divisor);
281 282
282 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 283 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
283 284
284 set_cpus_allowed_ptr(current, &cpus_allowed); 285 set_cpus_allowed_ptr(current, &cpus_allowed);
285} 286}
@@ -295,7 +296,7 @@ static int us2e_freq_target(struct cpufreq_policy *policy,
295 target_freq, relation, &new_index)) 296 target_freq, relation, &new_index))
296 return -EINVAL; 297 return -EINVAL;
297 298
298 us2e_set_cpu_divider_index(policy->cpu, new_index); 299 us2e_set_cpu_divider_index(policy, new_index);
299 300
300 return 0; 301 return 0;
301} 302}
@@ -335,7 +336,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
335static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) 336static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
336{ 337{
337 if (cpufreq_us2e_driver) 338 if (cpufreq_us2e_driver)
338 us2e_set_cpu_divider_index(policy->cpu, 0); 339 us2e_set_cpu_divider_index(policy, 0);
339 340
340 return 0; 341 return 0;
341} 342}