Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116350
b: refs/heads/master
c: 5cd1c9c
h: refs/heads/master
v: v3
  • Loading branch information
Roman Zippel authored and Thomas Gleixner committed Sep 24, 2008
1 parent fd99c6f commit 6f261cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb3f938fd6292dc79f43a5fe14784b044776e9f0
refs/heads/master: 5cd1c9c5cf30d4b33df3d3f74d8142f278d536b7
9 changes: 6 additions & 3 deletions trunk/kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void update_wall_time(void)
#else
offset = clock->cycle_interval;
#endif
clock->xtime_nsec += (s64)xtime.tv_nsec << clock->shift;
clock->xtime_nsec = (s64)xtime.tv_nsec << clock->shift;

/* normally this loop will run just once, however in the
* case of lost or late ticks, it will accumulate correctly.
Expand All @@ -479,9 +479,12 @@ void update_wall_time(void)
/* correct the clock when NTP error is too big */
clocksource_adjust(offset);

/* store full nanoseconds into xtime */
xtime.tv_nsec = (s64)clock->xtime_nsec >> clock->shift;
/* store full nanoseconds into xtime after rounding it up and
* add the remainder to the error difference.
*/
xtime.tv_nsec = ((s64)clock->xtime_nsec >> clock->shift) + 1;
clock->xtime_nsec -= (s64)xtime.tv_nsec << clock->shift;
clock->error += clock->xtime_nsec << (NTP_SCALE_SHIFT - clock->shift);

update_xtime_cache(cyc2ns(clock, offset));

Expand Down

0 comments on commit 6f261cc

Please sign in to comment.