aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/e_powersaver.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/e_powersaver.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/e_powersaver.c')
-rw-r--r--drivers/cpufreq/e_powersaver.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c
index 3fffbe6025cd..37380fb92621 100644
--- a/drivers/cpufreq/e_powersaver.c
+++ b/drivers/cpufreq/e_powersaver.c
@@ -104,7 +104,7 @@ static unsigned int eps_get(unsigned int cpu)
104} 104}
105 105
106static int eps_set_state(struct eps_cpu_data *centaur, 106static int eps_set_state(struct eps_cpu_data *centaur,
107 unsigned int cpu, 107 struct cpufreq_policy *policy,
108 u32 dest_state) 108 u32 dest_state)
109{ 109{
110 struct cpufreq_freqs freqs; 110 struct cpufreq_freqs freqs;
@@ -112,10 +112,9 @@ static int eps_set_state(struct eps_cpu_data *centaur,
112 int err = 0; 112 int err = 0;
113 int i; 113 int i;
114 114
115 freqs.old = eps_get(cpu); 115 freqs.old = eps_get(policy->cpu);
116 freqs.new = centaur->fsb * ((dest_state >> 8) & 0xff); 116 freqs.new = centaur->fsb * ((dest_state >> 8) & 0xff);
117 freqs.cpu = cpu; 117 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
118 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
119 118
120 /* Wait while CPU is busy */ 119 /* Wait while CPU is busy */
121 rdmsr(MSR_IA32_PERF_STATUS, lo, hi); 120 rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
@@ -162,7 +161,7 @@ postchange:
162 current_multiplier); 161 current_multiplier);
163 } 162 }
164#endif 163#endif
165 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 164 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
166 return err; 165 return err;
167} 166}
168 167
@@ -190,7 +189,7 @@ static int eps_target(struct cpufreq_policy *policy,
190 189
191 /* Make frequency transition */ 190 /* Make frequency transition */
192 dest_state = centaur->freq_table[newstate].index & 0xffff; 191 dest_state = centaur->freq_table[newstate].index & 0xffff;
193 ret = eps_set_state(centaur, cpu, dest_state); 192 ret = eps_set_state(centaur, policy, dest_state);
194 if (ret) 193 if (ret)
195 printk(KERN_ERR "eps: Timeout!\n"); 194 printk(KERN_ERR "eps: Timeout!\n");
196 return ret; 195 return ret;