aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/gx-suspmod.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/gx-suspmod.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/gx-suspmod.c')
-rw-r--r--drivers/cpufreq/gx-suspmod.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/cpufreq/gx-suspmod.c b/drivers/cpufreq/gx-suspmod.c
index 456bee058fe6..3dfc99b9ca86 100644
--- a/drivers/cpufreq/gx-suspmod.c
+++ b/drivers/cpufreq/gx-suspmod.c
@@ -251,14 +251,13 @@ static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration,
251 * set cpu speed in khz. 251 * set cpu speed in khz.
252 **/ 252 **/
253 253
254static void gx_set_cpuspeed(unsigned int khz) 254static void gx_set_cpuspeed(struct cpufreq_policy *policy, unsigned int khz)
255{ 255{
256 u8 suscfg, pmer1; 256 u8 suscfg, pmer1;
257 unsigned int new_khz; 257 unsigned int new_khz;
258 unsigned long flags; 258 unsigned long flags;
259 struct cpufreq_freqs freqs; 259 struct cpufreq_freqs freqs;
260 260
261 freqs.cpu = 0;
262 freqs.old = gx_get_cpuspeed(0); 261 freqs.old = gx_get_cpuspeed(0);
263 262
264 new_khz = gx_validate_speed(khz, &gx_params->on_duration, 263 new_khz = gx_validate_speed(khz, &gx_params->on_duration,
@@ -266,11 +265,9 @@ static void gx_set_cpuspeed(unsigned int khz)
266 265
267 freqs.new = new_khz; 266 freqs.new = new_khz;
268 267
269 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 268 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
270 local_irq_save(flags); 269 local_irq_save(flags);
271 270
272
273
274 if (new_khz != stock_freq) { 271 if (new_khz != stock_freq) {
275 /* if new khz == 100% of CPU speed, it is special case */ 272 /* if new khz == 100% of CPU speed, it is special case */
276 switch (gx_params->cs55x0->device) { 273 switch (gx_params->cs55x0->device) {
@@ -317,7 +314,7 @@ static void gx_set_cpuspeed(unsigned int khz)
317 314
318 gx_params->pci_suscfg = suscfg; 315 gx_params->pci_suscfg = suscfg;
319 316
320 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 317 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
321 318
322 pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n", 319 pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n",
323 gx_params->on_duration * 32, gx_params->off_duration * 32); 320 gx_params->on_duration * 32, gx_params->off_duration * 32);
@@ -397,7 +394,7 @@ static int cpufreq_gx_target(struct cpufreq_policy *policy,
397 tmp_freq = gx_validate_speed(tmp_freq, &tmp1, &tmp2); 394 tmp_freq = gx_validate_speed(tmp_freq, &tmp1, &tmp2);
398 } 395 }
399 396
400 gx_set_cpuspeed(tmp_freq); 397 gx_set_cpuspeed(policy, tmp_freq);
401 398
402 return 0; 399 return 0;
403} 400}