diff options
author | Jordan Hargrave <jordan_hargrave@dell.com> | 2006-04-07 13:50:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-09 14:53:53 -0400 |
commit | b20367a6c2a0cd937cb1f0a8cf848f1402fef99c (patch) | |
tree | 8624096baed40f8f89e757b2d170a7b4d1844575 /kernel/timer.c | |
parent | 49c93e84d8b2d602a07c302c7e3cd4fa09095fbb (diff) |
[PATCH] x86_64: Fix drift with HPET timer enabled
If the HPET timer is enabled, the clock can drift by ~3 seconds a day.
This is due to the HPET timer not being initialized with the correct
setting (still using PIT count).
If HZ changes, this drift can become even more pronounced.
HPET patch initializes tick_nsec with correct tick_nsec settings for
HPET timer.
Vojtech comments:
"It's not entirely correct (it assumes the HPET ticks totally
exactly), but it's significantly better than assuming the PIT error
there."
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index c3a874f1393c..471ab8710b8f 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1455,7 +1455,7 @@ static void time_interpolator_update(long delta_nsec) | |||
1455 | */ | 1455 | */ |
1456 | if (jiffies % INTERPOLATOR_ADJUST == 0) | 1456 | if (jiffies % INTERPOLATOR_ADJUST == 0) |
1457 | { | 1457 | { |
1458 | if (time_interpolator->skips == 0 && time_interpolator->offset > TICK_NSEC) | 1458 | if (time_interpolator->skips == 0 && time_interpolator->offset > tick_nsec) |
1459 | time_interpolator->nsec_per_cyc--; | 1459 | time_interpolator->nsec_per_cyc--; |
1460 | if (time_interpolator->ns_skipped > INTERPOLATOR_MAX_SKIP && time_interpolator->offset == 0) | 1460 | if (time_interpolator->ns_skipped > INTERPOLATOR_MAX_SKIP && time_interpolator->offset == 0) |
1461 | time_interpolator->nsec_per_cyc++; | 1461 | time_interpolator->nsec_per_cyc++; |