aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2013-12-11 21:50:25 -0500
committerJohn Stultz <john.stultz@linaro.org>2013-12-23 14:47:35 -0500
commitf55c07607a38f84b5c7e6066ee1cfe433fa5643c (patch)
treed7e7e92c896b8041204210704cd47814ea1e13ac /kernel
parent0e6601eee039893a3f6420596ae4588d90d13cbe (diff)
timekeeping: Fix lost updates to tai adjustment
Since 48cdc135d4840 (Implement a shadow timekeeper), we have to call timekeeping_update() after any adjustment to the timekeeping structure in order to make sure that any adjustments to the structure persist. Unfortunately, the updates to the tai offset via adjtimex do not trigger this update, causing adjustments to the tai offset to be made and then over-written by the previous value at the next update_wall_time() call. This patch resovles the issue by calling timekeeping_update() right after setting the tai offset. Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: stable <stable@vger.kernel.org> #3.10+ Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/timekeeping.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 3abf53418b67..7488f0b97dee 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -610,6 +610,7 @@ void timekeeping_set_tai_offset(s32 tai_offset)
610 raw_spin_lock_irqsave(&timekeeper_lock, flags); 610 raw_spin_lock_irqsave(&timekeeper_lock, flags);
611 write_seqcount_begin(&timekeeper_seq); 611 write_seqcount_begin(&timekeeper_seq);
612 __timekeeping_set_tai_offset(tk, tai_offset); 612 __timekeeping_set_tai_offset(tk, tai_offset);
613 timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
613 write_seqcount_end(&timekeeper_seq); 614 write_seqcount_end(&timekeeper_seq);
614 raw_spin_unlock_irqrestore(&timekeeper_lock, flags); 615 raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
615 clock_was_set(); 616 clock_was_set();
@@ -1698,7 +1699,7 @@ int do_adjtimex(struct timex *txc)
1698 1699
1699 if (tai != orig_tai) { 1700 if (tai != orig_tai) {
1700 __timekeeping_set_tai_offset(tk, tai); 1701 __timekeeping_set_tai_offset(tk, tai);
1701 update_pvclock_gtod(tk, true); 1702 timekeeping_update(tk, TK_MIRROR | TK_CLOCK_WAS_SET);
1702 clock_was_set_delayed(); 1703 clock_was_set_delayed();
1703 } 1704 }
1704 write_seqcount_end(&timekeeper_seq); 1705 write_seqcount_end(&timekeeper_seq);