mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
timekeeping: Increment clock_was_set_seq in timekeeping_init()
commit56fd16cabaupstream. 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:868a3e915f"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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0c6eb5c355
commit
31a07f6dc6
@@ -1244,7 +1244,7 @@ void __init timekeeping_init(void)
|
|||||||
set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec);
|
set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec);
|
||||||
tk_set_wall_to_mono(tk, tmp);
|
tk_set_wall_to_mono(tk, tmp);
|
||||||
|
|
||||||
timekeeping_update(tk, TK_MIRROR);
|
timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
|
||||||
|
|
||||||
write_seqcount_end(&tk_core.seq);
|
write_seqcount_end(&tk_core.seq);
|
||||||
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
|
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
|
||||||
|
|||||||
Reference in New Issue
Block a user