mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
ee41eebf9c
commit
ee7a1438b5
|
@ -13,7 +13,7 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/cpuidle.h>
|
#include <linux/cpuidle.h>
|
||||||
#include <linux/cpumask.h>
|
#include <linux/cpumask.h>
|
||||||
#include <linux/clockchips.h>
|
#include <linux/tick.h>
|
||||||
|
|
||||||
#include "cpuidle.h"
|
#include "cpuidle.h"
|
||||||
|
|
||||||
|
@ -130,21 +130,20 @@ static inline void __cpuidle_unset_driver(struct cpuidle_driver *drv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cpuidle_setup_broadcast_timer - enable/disable the broadcast timer
|
* cpuidle_setup_broadcast_timer - enable/disable the broadcast timer on a cpu
|
||||||
* @arg: a void pointer used to match the SMP cross call API
|
* @arg: a void pointer used to match the SMP cross call API
|
||||||
*
|
*
|
||||||
* @arg is used as a value of type 'long' with one of the two values:
|
* If @arg is NULL broadcast is disabled otherwise enabled
|
||||||
* - CLOCK_EVT_NOTIFY_BROADCAST_ON
|
|
||||||
* - CLOCK_EVT_NOTIFY_BROADCAST_OFF
|
|
||||||
*
|
*
|
||||||
* Set the broadcast timer notification for the current CPU. This function
|
* This function is executed per CPU by an SMP cross call. It's not
|
||||||
* is executed per CPU by an SMP cross call. It not supposed to be called
|
* supposed to be called directly.
|
||||||
* directly.
|
|
||||||
*/
|
*/
|
||||||
static void cpuidle_setup_broadcast_timer(void *arg)
|
static void cpuidle_setup_broadcast_timer(void *arg)
|
||||||
{
|
{
|
||||||
int cpu = smp_processor_id();
|
if (arg)
|
||||||
clockevents_notify((long)(arg), &cpu);
|
tick_broadcast_enable();
|
||||||
|
else
|
||||||
|
tick_broadcast_disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -239,7 +238,7 @@ static int __cpuidle_register_driver(struct cpuidle_driver *drv)
|
||||||
|
|
||||||
if (drv->bctimer)
|
if (drv->bctimer)
|
||||||
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
|
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
|
||||||
(void *)CLOCK_EVT_NOTIFY_BROADCAST_ON, 1);
|
(void *)1, 1);
|
||||||
|
|
||||||
poll_idle_init(drv);
|
poll_idle_init(drv);
|
||||||
|
|
||||||
|
@ -263,7 +262,7 @@ static void __cpuidle_unregister_driver(struct cpuidle_driver *drv)
|
||||||
if (drv->bctimer) {
|
if (drv->bctimer) {
|
||||||
drv->bctimer = 0;
|
drv->bctimer = 0;
|
||||||
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
|
on_each_cpu_mask(drv->cpumask, cpuidle_setup_broadcast_timer,
|
||||||
(void *)CLOCK_EVT_NOTIFY_BROADCAST_OFF, 1);
|
NULL, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
__cpuidle_unset_driver(drv);
|
__cpuidle_unset_driver(drv);
|
||||||
|
|
Loading…
Reference in New Issue