aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/omap-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/omap-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/omap-cpufreq.c')
-rw-r--r--drivers/cpufreq/omap-cpufreq.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index 9128c07bafba..b610edd820b1 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -88,16 +88,12 @@ static int omap_target(struct cpufreq_policy *policy,
88 } 88 }
89 89
90 freqs.old = omap_getspeed(policy->cpu); 90 freqs.old = omap_getspeed(policy->cpu);
91 freqs.cpu = policy->cpu;
92 91
93 if (freqs.old == freqs.new && policy->cur == freqs.new) 92 if (freqs.old == freqs.new && policy->cur == freqs.new)
94 return ret; 93 return ret;
95 94
96 /* notifiers */ 95 /* notifiers */
97 for_each_cpu(i, policy->cpus) { 96 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
98 freqs.cpu = i;
99 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
100 }
101 97
102 freq = freqs.new * 1000; 98 freq = freqs.new * 1000;
103 ret = clk_round_rate(mpu_clk, freq); 99 ret = clk_round_rate(mpu_clk, freq);
@@ -157,10 +153,7 @@ static int omap_target(struct cpufreq_policy *policy,
157 153
158done: 154done:
159 /* notifiers */ 155 /* notifiers */
160 for_each_cpu(i, policy->cpus) { 156 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
161 freqs.cpu = i;
162 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
163 }
164 157
165 return ret; 158 return ret;
166} 159}