diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-10-16 09:50:22 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-10-16 09:50:22 -0400 |
commit | 56fd16cabac9cd8f15e2902898a9d0cc96e2fa70 (patch) | |
tree | eb7e2ced8a9f8275d65e3b4ac9f8b66d5f0af023 | |
parent | 25cb62b76430a91cc6195f902e61c2cb84ade622 (diff) |
timekeeping: Increment clock_was_set_seq in timekeeping_init()
timekeeping_init() can set the wall time offset, so we need to
increment the clock_was_set_seq counter. That way hrtimers will pick
up the early offset immediately. Otherwise on a machine which does not
set wall time later in the boot process the hrtimer offset is stale at
0 and wall time timers are going to expire with a delay of 45 years.
Fixes: 868a3e915f7f "hrtimer: Make offset update smarter"
Reported-and-tested-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Stefan Liebler <stli@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | kernel/time/timekeeping.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 3739ac6aa473..44d2cc0436f4 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1251,7 +1251,7 @@ void __init timekeeping_init(void) | |||
1251 | set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec); | 1251 | set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec); |
1252 | tk_set_wall_to_mono(tk, tmp); | 1252 | tk_set_wall_to_mono(tk, tmp); |
1253 | 1253 | ||
1254 | timekeeping_update(tk, TK_MIRROR); | 1254 | timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET); |
1255 | 1255 | ||
1256 | write_seqcount_end(&tk_core.seq); | 1256 | write_seqcount_end(&tk_core.seq); |
1257 | raw_spin_unlock_irqrestore(&timekeeper_lock, flags); | 1257 | raw_spin_unlock_irqrestore(&timekeeper_lock, flags); |