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>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
fd143b4d6f
commit
b43a7ffbf3
@@ -117,15 +117,15 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu)
|
||||
* There is no return value.
|
||||
*/
|
||||
|
||||
static void elanfreq_set_cpu_state(unsigned int state)
|
||||
static void elanfreq_set_cpu_state(struct cpufreq_policy *policy,
|
||||
unsigned int state)
|
||||
{
|
||||
struct cpufreq_freqs freqs;
|
||||
|
||||
freqs.old = elanfreq_get_cpu_frequency(0);
|
||||
freqs.new = elan_multiplier[state].clock;
|
||||
freqs.cpu = 0; /* elanfreq.c is UP only driver */
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||
cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
|
||||
|
||||
printk(KERN_INFO "elanfreq: attempting to set frequency to %i kHz\n",
|
||||
elan_multiplier[state].clock);
|
||||
@@ -161,7 +161,7 @@ static void elanfreq_set_cpu_state(unsigned int state)
|
||||
udelay(10000);
|
||||
local_irq_enable();
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
|
||||
};
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ static int elanfreq_target(struct cpufreq_policy *policy,
|
||||
target_freq, relation, &newstate))
|
||||
return -EINVAL;
|
||||
|
||||
elanfreq_set_cpu_state(newstate);
|
||||
elanfreq_set_cpu_state(policy, newstate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user