Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpuidle: Use explicit broadcast control function

Replace the clockevents_notify() call with an explicit function call.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/2106401.cYdJzzA6Ic@vostro.rjw.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Thomas Gleixner and committed by
Ingo Molnar
ee7a1438 ee41eebf

+11 -12
+11 -12
drivers/cpuidle/driver.c
··· 13 13 #include <linux/sched.h> 14 14 #include <linux/cpuidle.h> 15 15 #include <linux/cpumask.h> 16 - #include <linux/clockchips.h> 16 + #include <linux/tick.h> 17 17 18 18 #include "cpuidle.h" 19 19 ··· 130 130 #endif 131 131 132 132 /** 133 - * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer 133 + * cpuidle_setup_broadcast_timer - enable/disable the broadcast timer on a cpu 134 134 * @arg: a void pointer used to match the SMP cross call API 135 135 * 136 - * @arg is used as a value of type 'long' with one of the two values: 137 - * - CLOCK_EVT_NOTIFY_BROADCAST_ON 138 - * - CLOCK_EVT_NOTIFY_BROADCAST_OFF 136 + * If @arg is NULL broadcast is disabled otherwise enabled 139 137 * 140 - * Set the broadcast timer notification for the current CPU. This function 141 - * is executed per CPU by an SMP cross call. It not supposed to be called 142 - * directly. 138 + * This function is executed per CPU by an SMP cross call. It's not 139 + * supposed to be called directly. 143 140 */ 144 141 static void cpuidle_setup_broadcast_timer(void *arg) 145 142 { 146 - int cpu = smp_processor_id(); 147 - clockevents_notify((long)(arg), &cpu); 143 + if (arg) 144 + tick_broadcast_enable(); 145 + else 146 + tick_broadcast_disable(); 148 147 } 149 148 150 149 /** ··· 238 239 239 240 if (drv->bctimer) 240 241 on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer, 241 - (void *)CLOCK_EVT_NOTIFY_BROADCAST_ON, 1); 242 + (void *)1, 1); 242 243 243 244 poll_idle_init(drv); 244 245 ··· 262 263 if (drv->bctimer) { 263 264 drv->bctimer = 0; 264 265 on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer, 265 - (void *)CLOCK_EVT_NOTIFY_BROADCAST_OFF, 1); 266 + NULL, 1); 266 267 } 267 268 268 269 __cpuidle_unset_driver(drv);