diff options
-rw-r--r-- | include/linux/timekeeper_internal.h | 2 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h index a151bd70e52b..c1825eb436ed 100644 --- a/include/linux/timekeeper_internal.h +++ b/include/linux/timekeeper_internal.h | |||
@@ -20,6 +20,8 @@ struct timekeeper { | |||
20 | u32 shift; | 20 | u32 shift; |
21 | /* Number of clock cycles in one NTP interval. */ | 21 | /* Number of clock cycles in one NTP interval. */ |
22 | cycle_t cycle_interval; | 22 | cycle_t cycle_interval; |
23 | /* Last cycle value (also stored in clock->cycle_last) */ | ||
24 | cycle_t cycle_last; | ||
23 | /* Number of clock shifted nano seconds in one NTP interval. */ | 25 | /* Number of clock shifted nano seconds in one NTP interval. */ |
24 | u64 xtime_interval; | 26 | u64 xtime_interval; |
25 | /* shifted nano seconds left over when rounding cycle_interval */ | 27 | /* shifted nano seconds left over when rounding cycle_interval */ |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index f93f60cd97ad..4c276b2d022d 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -101,7 +101,7 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) | |||
101 | 101 | ||
102 | old_clock = tk->clock; | 102 | old_clock = tk->clock; |
103 | tk->clock = clock; | 103 | tk->clock = clock; |
104 | clock->cycle_last = clock->read(clock); | 104 | tk->cycle_last = clock->cycle_last = clock->read(clock); |
105 | 105 | ||
106 | /* Do the ns -> cycle conversion first, using original mult */ | 106 | /* Do the ns -> cycle conversion first, using original mult */ |
107 | tmp = NTP_INTERVAL_LENGTH; | 107 | tmp = NTP_INTERVAL_LENGTH; |
@@ -266,7 +266,7 @@ static void timekeeping_forward_now(struct timekeeper *tk) | |||
266 | clock = tk->clock; | 266 | clock = tk->clock; |
267 | cycle_now = clock->read(clock); | 267 | cycle_now = clock->read(clock); |
268 | cycle_delta = (cycle_now - clock->cycle_last) & clock->mask; | 268 | cycle_delta = (cycle_now - clock->cycle_last) & clock->mask; |
269 | clock->cycle_last = cycle_now; | 269 | tk->cycle_last = clock->cycle_last = cycle_now; |
270 | 270 | ||
271 | tk->xtime_nsec += cycle_delta * tk->mult; | 271 | tk->xtime_nsec += cycle_delta * tk->mult; |
272 | 272 | ||