diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-03-06 02:25:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-06 12:30:24 -0500 |
commit | 6321dd60c76b2e12383bc06046288b15397ed3a0 (patch) | |
tree | 4cea63e69ce4f6f5f7f94fc6905063efdde7974e /kernel/time/tick-broadcast.c | |
parent | c3442e296517aee733d62fc3fe03211598902c7d (diff) |
[PATCH] Save/restore periodic tick information over suspend/resume
The programming of periodic tick devices needs to be saved/restored
across suspend/resume - otherwise we might end up with a system coming
up that relies on getting a PIT (or HPET) interrupt, while those devices
default to 'no interrupts' after powerup. (To confuse things it worked
to a certain degree on some systems because the lapic gets initialized
as a side-effect of SMP bootup.)
This suspend / resume thing was dropped unintentionally during the
last-minute -mm code reshuffling.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/time/tick-broadcast.c')
-rw-r--r-- | kernel/time/tick-broadcast.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 12b3efeb9f6f..5567745470f7 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -284,6 +284,42 @@ void tick_shutdown_broadcast(unsigned int *cpup) | |||
284 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); | 284 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); |
285 | } | 285 | } |
286 | 286 | ||
287 | void tick_suspend_broadcast(void) | ||
288 | { | ||
289 | struct clock_event_device *bc; | ||
290 | unsigned long flags; | ||
291 | |||
292 | spin_lock_irqsave(&tick_broadcast_lock, flags); | ||
293 | |||
294 | bc = tick_broadcast_device.evtdev; | ||
295 | if (bc && tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) | ||
296 | clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN); | ||
297 | |||
298 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); | ||
299 | } | ||
300 | |||
301 | int tick_resume_broadcast(void) | ||
302 | { | ||
303 | struct clock_event_device *bc; | ||
304 | unsigned long flags; | ||
305 | int broadcast = 0; | ||
306 | |||
307 | spin_lock_irqsave(&tick_broadcast_lock, flags); | ||
308 | |||
309 | bc = tick_broadcast_device.evtdev; | ||
310 | if (bc) { | ||
311 | if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC && | ||
312 | !cpus_empty(tick_broadcast_mask)) | ||
313 | tick_broadcast_start_periodic(bc); | ||
314 | |||
315 | broadcast = cpu_isset(smp_processor_id(), tick_broadcast_mask); | ||
316 | } | ||
317 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); | ||
318 | |||
319 | return broadcast; | ||
320 | } | ||
321 | |||
322 | |||
287 | #ifdef CONFIG_TICK_ONESHOT | 323 | #ifdef CONFIG_TICK_ONESHOT |
288 | 324 | ||
289 | static cpumask_t tick_broadcast_oneshot_mask; | 325 | static cpumask_t tick_broadcast_oneshot_mask; |