aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-02-21 17:51:39 -0500
committerJohn Stultz <john.stultz@linaro.org>2013-04-04 16:18:31 -0400
commit7ec98e15aa049b7a2ca73485f31cf4f90c34e2dd (patch)
tree9cfe66164c13f1c2413fb2c8335971918e43d6c9 /kernel/time
parent14a3b6abe98c8f53a13522610c257accef7321df (diff)
timekeeping: Delay update of clock->cycle_last
For calculating the new timekeeper values store the new cycle_last value in the timekeeper and update the clock->cycle_last just when we actually update the new values. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/timekeeping.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 4c276b2d022d..38ac782c0ef8 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1271,7 +1271,7 @@ static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset,
1271 1271
1272 /* Accumulate one shifted interval */ 1272 /* Accumulate one shifted interval */
1273 offset -= interval; 1273 offset -= interval;
1274 tk->clock->cycle_last += interval; 1274 tk->cycle_last += interval;
1275 1275
1276 tk->xtime_nsec += tk->xtime_interval << shift; 1276 tk->xtime_nsec += tk->xtime_interval << shift;
1277 accumulate_nsecs_to_secs(tk); 1277 accumulate_nsecs_to_secs(tk);
@@ -1386,6 +1386,8 @@ static void update_wall_time(void)
1386 */ 1386 */
1387 accumulate_nsecs_to_secs(tk); 1387 accumulate_nsecs_to_secs(tk);
1388 1388
1389 /* Update clock->cycle_last with the new value */
1390 clock->cycle_last = tk->cycle_last;
1389 timekeeping_update(tk, false); 1391 timekeeping_update(tk, false);
1390 1392
1391out: 1393out: