clockevents: fix resume logic
We need to make sure, that the clockevent devices are resumed, before the tick is resumed. The current resume logic does not guarantee this. Add CLOCK_EVT_MODE_RESUME and call the set mode functions of the clock event devices before resuming the tick / oneshot functionality. Fixup the existing users. Thanks to Nigel Cunningham for tracking down a long standing thinko, which affected the jinxed VAIO. [akpm@linux-foundation.org: xen build fix] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: john stultz <johnstul@us.ibm.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
93da56efcf
commit
18de5bc4c1
@@ -49,7 +49,7 @@ cpumask_t *tick_get_broadcast_mask(void)
|
||||
*/
|
||||
static void tick_broadcast_start_periodic(struct clock_event_device *bc)
|
||||
{
|
||||
if (bc && bc->mode == CLOCK_EVT_MODE_SHUTDOWN)
|
||||
if (bc)
|
||||
tick_setup_periodic(bc, 1);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ void tick_suspend_broadcast(void)
|
||||
spin_lock_irqsave(&tick_broadcast_lock, flags);
|
||||
|
||||
bc = tick_broadcast_device.evtdev;
|
||||
if (bc && tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)
|
||||
if (bc)
|
||||
clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
|
||||
|
||||
spin_unlock_irqrestore(&tick_broadcast_lock, flags);
|
||||
@@ -316,6 +316,8 @@ int tick_resume_broadcast(void)
|
||||
bc = tick_broadcast_device.evtdev;
|
||||
|
||||
if (bc) {
|
||||
clockevents_set_mode(bc, CLOCK_EVT_MODE_RESUME);
|
||||
|
||||
switch (tick_broadcast_device.mode) {
|
||||
case TICKDEV_MODE_PERIODIC:
|
||||
if(!cpus_empty(tick_broadcast_mask))
|
||||
|
Reference in New Issue
Block a user