diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-07-04 17:11:22 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-07-04 17:11:22 -0400 |
commit | 2b0f89317e99735bbf32eaede81f707f98ab1b5e (patch) | |
tree | 16daa236e21876b11f1c0b9256cd4046aadba020 /kernel/time | |
parent | 07bd1172902e782f288e4d44b1fde7dec0f08b6f (diff) | |
parent | fa18f7bde3ad4568d1d343b60d963bfbd8dc3991 (diff) |
Merge branch 'timers/posix-cpu-timers-for-tglx' of
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into timers/core
Frederic sayed: "Most of these patches have been hanging around for
several month now, in -mmotm for a significant chunk. They already
missed a few releases."
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/ntp.c | 1 | ||||
-rw-r--r-- | kernel/time/tick-broadcast.c | 19 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 2 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 8 |
4 files changed, 21 insertions, 9 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 12ff13a838c6..8f5b3b98577b 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -874,7 +874,6 @@ static void hardpps_update_phase(long error) | |||
874 | void __hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts) | 874 | void __hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts) |
875 | { | 875 | { |
876 | struct pps_normtime pts_norm, freq_norm; | 876 | struct pps_normtime pts_norm, freq_norm; |
877 | unsigned long flags; | ||
878 | 877 | ||
879 | pts_norm = pps_normalize_ts(*phase_ts); | 878 | pts_norm = pps_normalize_ts(*phase_ts); |
880 | 879 | ||
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 4430fa695b48..6d3f91631de6 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -583,6 +583,12 @@ again: | |||
583 | } | 583 | } |
584 | } | 584 | } |
585 | 585 | ||
586 | /* | ||
587 | * Remove the current cpu from the pending mask. The event is | ||
588 | * delivered immediately in tick_do_broadcast() ! | ||
589 | */ | ||
590 | cpumask_clear_cpu(smp_processor_id(), tick_broadcast_pending_mask); | ||
591 | |||
586 | /* Take care of enforced broadcast requests */ | 592 | /* Take care of enforced broadcast requests */ |
587 | cpumask_or(tmpmask, tmpmask, tick_broadcast_force_mask); | 593 | cpumask_or(tmpmask, tmpmask, tick_broadcast_force_mask); |
588 | cpumask_clear(tick_broadcast_force_mask); | 594 | cpumask_clear(tick_broadcast_force_mask); |
@@ -654,8 +660,8 @@ void tick_broadcast_oneshot_control(unsigned long reason) | |||
654 | 660 | ||
655 | raw_spin_lock_irqsave(&tick_broadcast_lock, flags); | 661 | raw_spin_lock_irqsave(&tick_broadcast_lock, flags); |
656 | if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ENTER) { | 662 | if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ENTER) { |
657 | WARN_ON_ONCE(cpumask_test_cpu(cpu, tick_broadcast_pending_mask)); | ||
658 | if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_oneshot_mask)) { | 663 | if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_oneshot_mask)) { |
664 | WARN_ON_ONCE(cpumask_test_cpu(cpu, tick_broadcast_pending_mask)); | ||
659 | clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN); | 665 | clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN); |
660 | /* | 666 | /* |
661 | * We only reprogram the broadcast timer if we | 667 | * We only reprogram the broadcast timer if we |
@@ -672,8 +678,6 @@ void tick_broadcast_oneshot_control(unsigned long reason) | |||
672 | } else { | 678 | } else { |
673 | if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) { | 679 | if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) { |
674 | clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT); | 680 | clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT); |
675 | if (dev->next_event.tv64 == KTIME_MAX) | ||
676 | goto out; | ||
677 | /* | 681 | /* |
678 | * The cpu which was handling the broadcast | 682 | * The cpu which was handling the broadcast |
679 | * timer marked this cpu in the broadcast | 683 | * timer marked this cpu in the broadcast |
@@ -688,6 +692,11 @@ void tick_broadcast_oneshot_control(unsigned long reason) | |||
688 | goto out; | 692 | goto out; |
689 | 693 | ||
690 | /* | 694 | /* |
695 | * Bail out if there is no next event. | ||
696 | */ | ||
697 | if (dev->next_event.tv64 == KTIME_MAX) | ||
698 | goto out; | ||
699 | /* | ||
691 | * If the pending bit is not set, then we are | 700 | * If the pending bit is not set, then we are |
692 | * either the CPU handling the broadcast | 701 | * either the CPU handling the broadcast |
693 | * interrupt or we got woken by something else. | 702 | * interrupt or we got woken by something else. |
@@ -771,10 +780,6 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) | |||
771 | 780 | ||
772 | bc->event_handler = tick_handle_oneshot_broadcast; | 781 | bc->event_handler = tick_handle_oneshot_broadcast; |
773 | 782 | ||
774 | /* Take the do_timer update */ | ||
775 | if (!tick_nohz_full_cpu(cpu)) | ||
776 | tick_do_timer_cpu = cpu; | ||
777 | |||
778 | /* | 783 | /* |
779 | * We must be careful here. There might be other CPUs | 784 | * We must be careful here. There might be other CPUs |
780 | * waiting for periodic broadcast. We need to set the | 785 | * waiting for periodic broadcast. We need to set the |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index f4208138fbf4..0cf1c1453181 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -306,7 +306,7 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb, | |||
306 | * we can't safely shutdown that CPU. | 306 | * we can't safely shutdown that CPU. |
307 | */ | 307 | */ |
308 | if (have_nohz_full_mask && tick_do_timer_cpu == cpu) | 308 | if (have_nohz_full_mask && tick_do_timer_cpu == cpu) |
309 | return -EINVAL; | 309 | return NOTIFY_BAD; |
310 | break; | 310 | break; |
311 | } | 311 | } |
312 | return NOTIFY_OK; | 312 | return NOTIFY_OK; |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 846d0a1f235e..48b9fffabdc2 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -991,6 +991,14 @@ static int timekeeping_suspend(void) | |||
991 | 991 | ||
992 | read_persistent_clock(&timekeeping_suspend_time); | 992 | read_persistent_clock(&timekeeping_suspend_time); |
993 | 993 | ||
994 | /* | ||
995 | * On some systems the persistent_clock can not be detected at | ||
996 | * timekeeping_init by its return value, so if we see a valid | ||
997 | * value returned, update the persistent_clock_exists flag. | ||
998 | */ | ||
999 | if (timekeeping_suspend_time.tv_sec || timekeeping_suspend_time.tv_nsec) | ||
1000 | persistent_clock_exist = true; | ||
1001 | |||
994 | raw_spin_lock_irqsave(&timekeeper_lock, flags); | 1002 | raw_spin_lock_irqsave(&timekeeper_lock, flags); |
995 | write_seqcount_begin(&timekeeper_seq); | 1003 | write_seqcount_begin(&timekeeper_seq); |
996 | timekeeping_forward_now(tk); | 1004 | timekeeping_forward_now(tk); |