aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
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/ia64
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/ia64')
-rw-r--r--arch/ia64/kernel/cpufreq/acpi-cpufreq.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
index f09b174244d5..4700fef8d1fa 100644
--- a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
+++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
@@ -137,7 +137,7 @@ migrate_end:
137static int 137static int
138processor_set_freq ( 138processor_set_freq (
139 struct cpufreq_acpi_io *data, 139 struct cpufreq_acpi_io *data,
140 unsigned int cpu, 140 struct cpufreq_policy *policy,
141 int state) 141 int state)
142{ 142{
143 int ret = 0; 143 int ret = 0;
@@ -149,8 +149,8 @@ processor_set_freq (
149 pr_debug("processor_set_freq\n"); 149 pr_debug("processor_set_freq\n");
150 150
151 saved_mask = current->cpus_allowed; 151 saved_mask = current->cpus_allowed;
152 set_cpus_allowed_ptr(current, cpumask_of(cpu)); 152 set_cpus_allowed_ptr(current, cpumask_of(policy->cpu));
153 if (smp_processor_id() != cpu) { 153 if (smp_processor_id() != policy->cpu) {
154 retval = -EAGAIN; 154 retval = -EAGAIN;
155 goto migrate_end; 155 goto migrate_end;
156 } 156 }
@@ -170,12 +170,11 @@ processor_set_freq (
170 data->acpi_data.state, state); 170 data->acpi_data.state, state);
171 171
172 /* cpufreq frequency struct */ 172 /* cpufreq frequency struct */
173 cpufreq_freqs.cpu = cpu;
174 cpufreq_freqs.old = data->freq_table[data->acpi_data.state].frequency; 173 cpufreq_freqs.old = data->freq_table[data->acpi_data.state].frequency;
175 cpufreq_freqs.new = data->freq_table[state].frequency; 174 cpufreq_freqs.new = data->freq_table[state].frequency;
176 175
177 /* notify cpufreq */ 176 /* notify cpufreq */
178 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE); 177 cpufreq_notify_transition(policy, &cpufreq_freqs, CPUFREQ_PRECHANGE);
179 178
180 /* 179 /*
181 * First we write the target state's 'control' value to the 180 * First we write the target state's 'control' value to the
@@ -189,17 +188,20 @@ processor_set_freq (
189 ret = processor_set_pstate(value); 188 ret = processor_set_pstate(value);
190 if (ret) { 189 if (ret) {
191 unsigned int tmp = cpufreq_freqs.new; 190 unsigned int tmp = cpufreq_freqs.new;
192 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE); 191 cpufreq_notify_transition(policy, &cpufreq_freqs,
192 CPUFREQ_POSTCHANGE);
193 cpufreq_freqs.new = cpufreq_freqs.old; 193 cpufreq_freqs.new = cpufreq_freqs.old;
194 cpufreq_freqs.old = tmp; 194 cpufreq_freqs.old = tmp;
195 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_PRECHANGE); 195 cpufreq_notify_transition(policy, &cpufreq_freqs,
196 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE); 196 CPUFREQ_PRECHANGE);
197 cpufreq_notify_transition(policy, &cpufreq_freqs,
198 CPUFREQ_POSTCHANGE);
197 printk(KERN_WARNING "Transition failed with error %d\n", ret); 199 printk(KERN_WARNING "Transition failed with error %d\n", ret);
198 retval = -ENODEV; 200 retval = -ENODEV;
199 goto migrate_end; 201 goto migrate_end;
200 } 202 }
201 203
202 cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE); 204 cpufreq_notify_transition(policy, &cpufreq_freqs, CPUFREQ_POSTCHANGE);
203 205
204 data->acpi_data.state = state; 206 data->acpi_data.state = state;
205 207
@@ -240,7 +242,7 @@ acpi_cpufreq_target (
240 if (result) 242 if (result)
241 return (result); 243 return (result);
242 244
243 result = processor_set_freq(data, policy->cpu, next_state); 245 result = processor_set_freq(data, policy, next_state);
244 246
245 return (result); 247 return (result);
246} 248}