aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-broadcast.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/tick-broadcast.c')
-rw-r--r--kernel/time/tick-broadcast.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index db8e0f3d409b..aab881c86a1a 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -382,12 +382,23 @@ static int tick_broadcast_set_event(ktime_t expires, int force)
382 382
383int tick_resume_broadcast_oneshot(struct clock_event_device *bc) 383int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
384{ 384{
385 int cpu = smp_processor_id();
386
387 /*
388 * If the CPU is marked for broadcast, enforce oneshot
389 * broadcast mode. The jinxed VAIO does not resume otherwise.
390 * No idea why it ends up in a lower C State during resume
391 * without notifying the clock events layer.
392 */
393 if (cpu_isset(cpu, tick_broadcast_mask))
394 cpu_set(cpu, tick_broadcast_oneshot_mask);
395
385 clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); 396 clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
386 397
387 if(!cpus_empty(tick_broadcast_oneshot_mask)) 398 if(!cpus_empty(tick_broadcast_oneshot_mask))
388 tick_broadcast_set_event(ktime_get(), 1); 399 tick_broadcast_set_event(ktime_get(), 1);
389 400
390 return cpu_isset(smp_processor_id(), tick_broadcast_oneshot_mask); 401 return cpu_isset(cpu, tick_broadcast_oneshot_mask);
391} 402}
392 403
393/* 404/*
@@ -549,20 +560,17 @@ void tick_broadcast_switch_to_oneshot(void)
549 */ 560 */
550void tick_shutdown_broadcast_oneshot(unsigned int *cpup) 561void tick_shutdown_broadcast_oneshot(unsigned int *cpup)
551{ 562{
552 struct clock_event_device *bc;
553 unsigned long flags; 563 unsigned long flags;
554 unsigned int cpu = *cpup; 564 unsigned int cpu = *cpup;
555 565
556 spin_lock_irqsave(&tick_broadcast_lock, flags); 566 spin_lock_irqsave(&tick_broadcast_lock, flags);
557 567
558 bc = tick_broadcast_device.evtdev; 568 /*
569 * Clear the broadcast mask flag for the dead cpu, but do not
570 * stop the broadcast device!
571 */
559 cpu_clear(cpu, tick_broadcast_oneshot_mask); 572 cpu_clear(cpu, tick_broadcast_oneshot_mask);
560 573
561 if (tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT) {
562 if (bc && cpus_empty(tick_broadcast_oneshot_mask))
563 clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN);
564 }
565
566 spin_unlock_irqrestore(&tick_broadcast_lock, flags); 574 spin_unlock_irqrestore(&tick_broadcast_lock, flags);
567} 575}
568 576