summaryrefslogtreecommitdiffstats
path: root/patches/0261-time-rt-Fix-up-leap-second-backport-for-RT-changes.patch
blob: 27bc47ca31e66f5708a65a036d9391c5cf744195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 1d937348e827066239787bef7bec92ccf972a9e9 Mon Sep 17 00:00:00 2001
From: Steven Rostedt <rostedt@goodmis.org>
Date: Thu, 2 Aug 2012 18:56:52 -0400
Subject: [PATCH 261/274] time/rt: Fix up leap-second backport for RT changes

The leap-second backport broke RT, and a few changes had to be done.

1) The second_overflow now encompasses ntp_leap_second, and since
second_overflow is called with the xtime_lock held, we can not take that
lock either. (this update was done during the rebase).

2) Change ktime_get_update_offsets() to use read_seqcount_begin() instead
of read_seq_begin() (and retry).

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/hrtimer.c          |    1 -
 kernel/time/timekeeping.c |    4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index bca6928..8b3d423 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1625,7 +1625,6 @@ static void run_hrtimer_softirq(struct softirq_action *h)
 		cpu_base->clock_was_set = 0;
 		clock_was_set();
 	}
-
 	hrtimer_rt_run_pending();
 }
 
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 1d263f5..da2fe62 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1333,7 +1333,7 @@ ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot)
 	u64 secs, nsecs;
 
 	do {
-		seq = read_seqbegin(&timekeeper.lock);
+		seq = read_seqcount_begin(&timekeeper.seq);
 
 		secs = timekeeper.xtime.tv_sec;
 		nsecs = timekeeper.xtime.tv_nsec;
@@ -1343,7 +1343,7 @@ ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot)
 
 		*offs_real = timekeeper.offs_real;
 		*offs_boot = timekeeper.offs_boot;
-	} while (read_seqretry(&timekeeper.lock, seq));
+	} while (read_seqcount_retry(&timekeeper.seq, seq));
 
 	now = ktime_add_ns(ktime_set(secs, 0), nsecs);
 	now = ktime_sub(now, *offs_real);
-- 
1.7.10.4