clockevents: Cleanup dead cpu explicitely
clockevents_notify() is a leftover from the early design of the clockevents facility. It's really not a notification mechanism, it's a multiplex call. We are way better off to have explicit calls instead of this monstrosity. Split out the cleanup function for a dead cpu and invoke it directly from the cpu down code. Make it conditional on CPU_HOTPLUG as well. Temporary change, will be refined in the future. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [ Rebased, added clockevents_notify() removal ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1735025.raBZdQHM3m@vostro.rjw.lan Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
52c063d1ad
commit
a49b116dcb
@@ -410,14 +410,14 @@ void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast)
|
||||
dev->event_handler = tick_handle_periodic_broadcast;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
/*
|
||||
* Remove a CPU from broadcasting
|
||||
*/
|
||||
void tick_shutdown_broadcast(unsigned int *cpup)
|
||||
void tick_shutdown_broadcast(unsigned int cpu)
|
||||
{
|
||||
struct clock_event_device *bc;
|
||||
unsigned long flags;
|
||||
unsigned int cpu = *cpup;
|
||||
|
||||
raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
|
||||
|
||||
@@ -432,6 +432,7 @@ void tick_shutdown_broadcast(unsigned int *cpup)
|
||||
|
||||
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
void tick_suspend_broadcast(void)
|
||||
{
|
||||
@@ -672,21 +673,6 @@ static void broadcast_shutdown_local(struct clock_event_device *bc,
|
||||
clockevents_set_state(dev, CLOCK_EVT_STATE_SHUTDOWN);
|
||||
}
|
||||
|
||||
void hotplug_cpu__broadcast_tick_pull(int deadcpu)
|
||||
{
|
||||
struct clock_event_device *bc;
|
||||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
|
||||
bc = tick_broadcast_device.evtdev;
|
||||
|
||||
if (bc && broadcast_needs_cpu(bc, deadcpu)) {
|
||||
/* This moves the broadcast assignment to this CPU: */
|
||||
clockevents_program_event(bc, bc->next_event, 1);
|
||||
}
|
||||
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* tick_broadcast_oneshot_control - Enter/exit broadcast oneshot mode
|
||||
* @state: The target state (enter/exit)
|
||||
@@ -908,14 +894,28 @@ void tick_broadcast_switch_to_oneshot(void)
|
||||
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
void hotplug_cpu__broadcast_tick_pull(int deadcpu)
|
||||
{
|
||||
struct clock_event_device *bc;
|
||||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
|
||||
bc = tick_broadcast_device.evtdev;
|
||||
|
||||
if (bc && broadcast_needs_cpu(bc, deadcpu)) {
|
||||
/* This moves the broadcast assignment to this CPU: */
|
||||
clockevents_program_event(bc, bc->next_event, 1);
|
||||
}
|
||||
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove a dead CPU from broadcasting
|
||||
*/
|
||||
void tick_shutdown_broadcast_oneshot(unsigned int *cpup)
|
||||
void tick_shutdown_broadcast_oneshot(unsigned int cpu)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned int cpu = *cpup;
|
||||
|
||||
raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
|
||||
|
||||
@@ -929,6 +929,7 @@ void tick_shutdown_broadcast_oneshot(unsigned int *cpup)
|
||||
|
||||
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check, whether the broadcast device is in one shot mode
|
||||
|
Reference in New Issue
Block a user