]> Pileus Git - ~andy/linux/commitdiff
timekeeping: Delay update of clock->cycle_last
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Feb 2013 22:51:39 +0000 (22:51 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Thu, 4 Apr 2013 20:18:31 +0000 (13:18 -0700)
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>
kernel/time/timekeeping.c

index 4c276b2d022d7d0202308c4a7a74ce0ccf7dc89d..38ac782c0ef83000531c2d53a5f95a3cb2ceddf4 100644 (file)
@@ -1271,7 +1271,7 @@ static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset,
 
        /* Accumulate one shifted interval */
        offset -= interval;
-       tk->clock->cycle_last += interval;
+       tk->cycle_last += interval;
 
        tk->xtime_nsec += tk->xtime_interval << shift;
        accumulate_nsecs_to_secs(tk);
@@ -1386,6 +1386,8 @@ static void update_wall_time(void)
         */
        accumulate_nsecs_to_secs(tk);
 
+       /* Update clock->cycle_last with the new value */
+       clock->cycle_last = tk->cycle_last;
        timekeeping_update(tk, false);
 
 out: