aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/powernow-k8.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-k8.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-k8.c')
-rw-r--r--drivers/cpufreq/powernow-k8.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index d13a13678b5f..52137a323965 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -928,9 +928,10 @@ static int get_transition_latency(struct powernow_k8_data *data)
928static int transition_frequency_fidvid(struct powernow_k8_data *data, 928static int transition_frequency_fidvid(struct powernow_k8_data *data,
929 unsigned int index) 929 unsigned int index)
930{ 930{
931 struct cpufreq_policy *policy;
931 u32 fid = 0; 932 u32 fid = 0;
932 u32 vid = 0; 933 u32 vid = 0;
933 int res, i; 934 int res;
934 struct cpufreq_freqs freqs; 935 struct cpufreq_freqs freqs;
935 936
936 pr_debug("cpu %d transition to index %u\n", smp_processor_id(), index); 937 pr_debug("cpu %d transition to index %u\n", smp_processor_id(), index);
@@ -959,10 +960,10 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
959 freqs.old = find_khz_freq_from_fid(data->currfid); 960 freqs.old = find_khz_freq_from_fid(data->currfid);
960 freqs.new = find_khz_freq_from_fid(fid); 961 freqs.new = find_khz_freq_from_fid(fid);
961 962
962 for_each_cpu(i, data->available_cores) { 963 policy = cpufreq_cpu_get(smp_processor_id());
963 freqs.cpu = i; 964 cpufreq_cpu_put(policy);
964 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 965
965 } 966 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
966 967
967 res = transition_fid_vid(data, fid, vid); 968 res = transition_fid_vid(data, fid, vid);
968 if (res) 969 if (res)
@@ -970,10 +971,7 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
970 971
971 freqs.new = find_khz_freq_from_fid(data->currfid); 972 freqs.new = find_khz_freq_from_fid(data->currfid);
972 973
973 for_each_cpu(i, data->available_cores) { 974 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
974 freqs.cpu = i;
975 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
976 }
977 return res; 975 return res;
978} 976}
979 977