[lkml]   [2019]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3/7] ARM: twd: Update cpufreq transition notifier to handle multiple CPUs
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

Signed-off-by: Viresh Kumar <>
arch/arm/kernel/smp_twd.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index b30eafeef096..df7db45d931b 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -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;
 \ /
  Last update: 2019-03-14 07:44    [W:0.175 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site