summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/powernow-k6.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/powernow-k6.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/powernow-k6.c')
-rw-r--r--drivers/cpufreq/powernow-k6.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c
index af23e0b9ec92..ea0222a45b7b 100644
--- a/drivers/cpufreq/powernow-k6.c
+++ b/drivers/cpufreq/powernow-k6.c
@@ -68,7 +68,8 @@ static int powernow_k6_get_cpu_multiplier(void)
68 * 68 *
69 * Tries to change the PowerNow! multiplier 69 * Tries to change the PowerNow! multiplier
70 */ 70 */
71static void powernow_k6_set_state(unsigned int best_i) 71static void powernow_k6_set_state(struct cpufreq_policy *policy,
72 unsigned int best_i)
72{ 73{
73 unsigned long outvalue = 0, invalue = 0; 74 unsigned long outvalue = 0, invalue = 0;
74 unsigned long msrval; 75 unsigned long msrval;
@@ -81,9 +82,8 @@ static void powernow_k6_set_state(unsigned int best_i)
81 82
82 freqs.old = busfreq * powernow_k6_get_cpu_multiplier(); 83 freqs.old = busfreq * powernow_k6_get_cpu_multiplier();
83 freqs.new = busfreq * clock_ratio[best_i].index; 84 freqs.new = busfreq * clock_ratio[best_i].index;
84 freqs.cpu = 0; /* powernow-k6.c is UP only driver */
85 85
86 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 86 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
87 87
88 /* we now need to transform best_i to the BVC format, see AMD#23446 */ 88 /* we now need to transform best_i to the BVC format, see AMD#23446 */
89 89
@@ -98,7 +98,7 @@ static void powernow_k6_set_state(unsigned int best_i)
98 msrval = POWERNOW_IOPORT + 0x0; 98 msrval = POWERNOW_IOPORT + 0x0;
99 wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */ 99 wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */
100 100
101 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 101 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
102 102
103 return; 103 return;
104} 104}
@@ -136,7 +136,7 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
136 target_freq, relation, &newstate)) 136 target_freq, relation, &newstate))
137 return -EINVAL; 137 return -EINVAL;
138 138
139 powernow_k6_set_state(newstate); 139 powernow_k6_set_state(policy, newstate);
140 140
141 return 0; 141 return 0;
142} 142}
@@ -182,7 +182,7 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
182 unsigned int i; 182 unsigned int i;
183 for (i = 0; i < 8; i++) { 183 for (i = 0; i < 8; i++) {
184 if (i == max_multiplier) 184 if (i == max_multiplier)
185 powernow_k6_set_state(i); 185 powernow_k6_set_state(policy, i);
186 } 186 }
187 cpufreq_frequency_table_put_attr(policy->cpu); 187 cpufreq_frequency_table_put_attr(policy->cpu);
188 return 0; 188 return 0;