diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch new file mode 100644 index 00000000..792fe390 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0077-time-Move-common-updates-to-a-function.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From 540e83f9da352839ff29ce5445fc499de8d54570 Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Gleixner <tglx@linutronix.de> | ||
3 | Date: Sun, 13 Nov 2011 23:19:49 +0000 | ||
4 | Subject: [PATCH 077/109] time: Move common updates to a function | ||
5 | |||
6 | This is a backport of cc06268c6a87db156af2daed6e96a936b955cc82 | ||
7 | |||
8 | [John Stultz: While not a bugfix itself, it allows following fixes | ||
9 | to backport in a more straightforward manner.] | ||
10 | |||
11 | CC: Thomas Gleixner <tglx@linutronix.de> | ||
12 | CC: Eric Dumazet <eric.dumazet@gmail.com> | ||
13 | CC: Richard Cochran <richardcochran@gmail.com> | ||
14 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
15 | Cc: Prarit Bhargava <prarit@redhat.com> | ||
16 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
17 | Cc: Linux Kernel <linux-kernel@vger.kernel.org> | ||
18 | Signed-off-by: John Stultz <john.stultz@linaro.org> | ||
19 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
20 | --- | ||
21 | kernel/time/timekeeping.c | 34 +++++++++++++++++----------------- | ||
22 | 1 files changed, 17 insertions(+), 17 deletions(-) | ||
23 | |||
24 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c | ||
25 | index 5c9b67e..5d55185 100644 | ||
26 | --- a/kernel/time/timekeeping.c | ||
27 | +++ b/kernel/time/timekeeping.c | ||
28 | @@ -166,6 +166,19 @@ static struct timespec total_sleep_time; | ||
29 | */ | ||
30 | static struct timespec raw_time; | ||
31 | |||
32 | +/* must hold write on xtime_lock */ | ||
33 | +static void timekeeping_update(bool clearntp) | ||
34 | +{ | ||
35 | + if (clearntp) { | ||
36 | + timekeeper.ntp_error = 0; | ||
37 | + ntp_clear(); | ||
38 | + } | ||
39 | + update_vsyscall(&xtime, &wall_to_monotonic, | ||
40 | + timekeeper.clock, timekeeper.mult); | ||
41 | +} | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | /* flag for if timekeeping is suspended */ | ||
46 | int __read_mostly timekeeping_suspended; | ||
47 | |||
48 | @@ -366,11 +379,7 @@ int do_settimeofday(const struct timespec *tv) | ||
49 | |||
50 | xtime = *tv; | ||
51 | |||
52 | - timekeeper.ntp_error = 0; | ||
53 | - ntp_clear(); | ||
54 | - | ||
55 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
56 | - timekeeper.mult); | ||
57 | + timekeeping_update(true); | ||
58 | |||
59 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
60 | |||
61 | @@ -403,11 +412,7 @@ int timekeeping_inject_offset(struct timespec *ts) | ||
62 | xtime = timespec_add(xtime, *ts); | ||
63 | wall_to_monotonic = timespec_sub(wall_to_monotonic, *ts); | ||
64 | |||
65 | - timekeeper.ntp_error = 0; | ||
66 | - ntp_clear(); | ||
67 | - | ||
68 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
69 | - timekeeper.mult); | ||
70 | + timekeeping_update(true); | ||
71 | |||
72 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
73 | |||
74 | @@ -636,10 +641,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta) | ||
75 | |||
76 | __timekeeping_inject_sleeptime(delta); | ||
77 | |||
78 | - timekeeper.ntp_error = 0; | ||
79 | - ntp_clear(); | ||
80 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
81 | - timekeeper.mult); | ||
82 | + timekeeping_update(true); | ||
83 | |||
84 | write_sequnlock_irqrestore(&xtime_lock, flags); | ||
85 | |||
86 | @@ -1052,9 +1054,7 @@ static void update_wall_time(void) | ||
87 | wall_to_monotonic.tv_sec -= leap; | ||
88 | } | ||
89 | |||
90 | - /* check to see if there is a new clocksource to use */ | ||
91 | - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, | ||
92 | - timekeeper.mult); | ||
93 | + timekeeping_update(false); | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | -- | ||
98 | 1.7.7.6 | ||
99 | |||