clockevents: Make suspend/resume calls explicit
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 suspend/resume() calls and invoke them directly from the call sites. No locking required at this point because these calls happen with interrupts disabled and a single cpu online. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [ Rebased on top of 4.0-rc5. ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/713674030.jVm1qaHuPf@vostro.rjw.lan [ Rebased on top of latest timers/core. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
db6f672ef1
commit
4ffee521f3
@@ -373,18 +373,39 @@ void tick_shutdown(unsigned int *cpup)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* tick_suspend - Suspend the tick and the broadcast device
|
||||
*
|
||||
* Called from syscore_suspend() via timekeeping_suspend with only one
|
||||
* CPU online and interrupts disabled or from tick_unfreeze() under
|
||||
* tick_freeze_lock.
|
||||
*
|
||||
* No locks required. Nothing can change the per cpu device.
|
||||
*/
|
||||
void tick_suspend(void)
|
||||
{
|
||||
struct tick_device *td = this_cpu_ptr(&tick_cpu_device);
|
||||
|
||||
clockevents_shutdown(td->evtdev);
|
||||
tick_suspend_broadcast();
|
||||
}
|
||||
|
||||
/**
|
||||
* tick_resume - Resume the tick and the broadcast device
|
||||
*
|
||||
* Called from syscore_resume() via timekeeping_resume with only one
|
||||
* CPU online and interrupts disabled or from tick_unfreeze() under
|
||||
* tick_freeze_lock.
|
||||
*
|
||||
* No locks required. Nothing can change the per cpu device.
|
||||
*/
|
||||
void tick_resume(void)
|
||||
{
|
||||
struct tick_device *td = this_cpu_ptr(&tick_cpu_device);
|
||||
int broadcast = tick_resume_broadcast();
|
||||
struct tick_device *td;
|
||||
int broadcast;
|
||||
|
||||
broadcast = tick_resume_broadcast();
|
||||
td = this_cpu_ptr(&tick_cpu_device);
|
||||
clockevents_tick_resume(td->evtdev);
|
||||
|
||||
if (!broadcast) {
|
||||
@@ -416,7 +437,6 @@ void tick_freeze(void)
|
||||
timekeeping_suspend();
|
||||
} else {
|
||||
tick_suspend();
|
||||
tick_suspend_broadcast();
|
||||
}
|
||||
|
||||
raw_spin_unlock(&tick_freeze_lock);
|
||||
|
Reference in New Issue
Block a user