]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.30/timekeeping-fix-lost-updates-to-tai-adjustment.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.30 / timekeeping-fix-lost-updates-to-tai-adjustment.patch
1 From f55c07607a38f84b5c7e6066ee1cfe433fa5643c Mon Sep 17 00:00:00 2001
2 From: John Stultz <john.stultz@linaro.org>
3 Date: Wed, 11 Dec 2013 18:50:25 -0800
4 Subject: timekeeping: Fix lost updates to tai adjustment
5
6 From: John Stultz <john.stultz@linaro.org>
7
8 commit f55c07607a38f84b5c7e6066ee1cfe433fa5643c upstream.
9
10 Since 48cdc135d4840 (Implement a shadow timekeeper), we have to
11 call timekeeping_update() after any adjustment to the timekeeping
12 structure in order to make sure that any adjustments to the structure
13 persist.
14
15 Unfortunately, the updates to the tai offset via adjtimex do not
16 trigger this update, causing adjustments to the tai offset to be
17 made and then over-written by the previous value at the next
18 update_wall_time() call.
19
20 This patch resovles the issue by calling timekeeping_update()
21 right after setting the tai offset.
22
23 Cc: Sasha Levin <sasha.levin@oracle.com>
24 Cc: Thomas Gleixner <tglx@linutronix.de>
25 Cc: Prarit Bhargava <prarit@redhat.com>
26 Cc: Richard Cochran <richardcochran@gmail.com>
27 Cc: Ingo Molnar <mingo@kernel.org>
28 Signed-off-by: John Stultz <john.stultz@linaro.org>
29 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30
31 ---
32 kernel/time/timekeeping.c | 2 ++
33 1 file changed, 2 insertions(+)
34
35 --- a/kernel/time/timekeeping.c
36 +++ b/kernel/time/timekeeping.c
37 @@ -605,6 +605,7 @@ void timekeeping_set_tai_offset(s32 tai_
38 raw_spin_lock_irqsave(&timekeeper_lock, flags);
39 write_seqcount_begin(&timekeeper_seq);
40 __timekeeping_set_tai_offset(tk, tai_offset);
41 + timekeeping_update(tk, false, true);
42 write_seqcount_end(&timekeeper_seq);
43 raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
44 clock_was_set();
45 @@ -1677,6 +1678,7 @@ int do_adjtimex(struct timex *txc)
46
47 if (tai != orig_tai) {
48 __timekeeping_set_tai_offset(tk, tai);
49 + timekeeping_update(tk, false, true);
50 clock_was_set_delayed();
51 }
52 write_seqcount_end(&timekeeper_seq);