aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/spear-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/spear-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/spear-cpufreq.c')
-rw-r--r--drivers/cpufreq/spear-cpufreq.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
index 7e4d77327957..156829f4576d 100644
--- a/drivers/cpufreq/spear-cpufreq.c
+++ b/drivers/cpufreq/spear-cpufreq.c
@@ -121,7 +121,6 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,
121 target_freq, relation, &index)) 121 target_freq, relation, &index))
122 return -EINVAL; 122 return -EINVAL;
123 123
124 freqs.cpu = policy->cpu;
125 freqs.old = spear_cpufreq_get(0); 124 freqs.old = spear_cpufreq_get(0);
126 125
127 newfreq = spear_cpufreq.freq_tbl[index].frequency * 1000; 126 newfreq = spear_cpufreq.freq_tbl[index].frequency * 1000;
@@ -158,8 +157,7 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,
158 freqs.new = newfreq / 1000; 157 freqs.new = newfreq / 1000;
159 freqs.new /= mult; 158 freqs.new /= mult;
160 159
161 for_each_cpu(freqs.cpu, policy->cpus) 160 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
162 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
163 161
164 if (mult == 2) 162 if (mult == 2)
165 ret = spear1340_set_cpu_rate(srcclk, newfreq); 163 ret = spear1340_set_cpu_rate(srcclk, newfreq);
@@ -172,8 +170,7 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy,
172 freqs.new = clk_get_rate(spear_cpufreq.clk) / 1000; 170 freqs.new = clk_get_rate(spear_cpufreq.clk) / 1000;
173 } 171 }
174 172
175 for_each_cpu(freqs.cpu, policy->cpus) 173 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
176 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
177 return ret; 174 return ret;
178} 175}
179 176