@@ -162,15 +162,18 @@ static int twd_cpufreq_transition(struct notifier_block *nb,
unsigned long state, void *data)
{
struct cpufreq_freqs *freqs = data;
+ int cpu;
/*
* The twd clock events must be reprogrammed to account for the new
* frequency. The timer is local to a cpu, so cross-call to the
* changing cpu.
*/
- if (state == CPUFREQ_POSTCHANGE)
- smp_call_function_single(freqs->cpu, twd_update_frequency,
- NULL, 1);
+ if (state != CPUFREQ_POSTCHANGE)
+ return NOTIFY_OK;
+
+ for_each_cpu_and(cpu, freqs->cpus, cpu_online_mask)
+ smp_call_function_single(cpu, twd_update_frequency, NULL, 1);
return NOTIFY_OK;
}
The cpufreq core currently calls the cpufreq transition notifier callback once for each affected CPU. This is going to change soon and the cpufreq core will call the callback only once for each cpufreq policy. The callback must look at the newly added field in struct cpufreq_freqs, "cpus", which contains policy->related_cpus (both online/offline CPUs) and perform per-cpu actions for them if any. This patch updates twd_cpufreq_transition() to use the new "cpus" field and run twd_update_frequency() for each online CPU present in the freqs->cpus. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- arch/arm/kernel/smp_twd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b