summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/tsc.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-09-04 22:47:47 +0200
committerIngo Molnar <mingo@elte.hu>2008-09-04 23:21:57 +0200
commit4156e9a8ef5b521185f451213d33fa661f38512e (patch)
treed6e8df44babd295a2d9e51bf95cfec6be1d758ee /arch/x86/kernel/tsc.c
parent6ac40ed0413ef4096720f966e11c7cdf259eee3f (diff)
downloadop-kernel-dev-4156e9a8ef5b521185f451213d33fa661f38512e.zip
op-kernel-dev-4156e9a8ef5b521185f451213d33fa661f38512e.tar.gz
x86: quick TSC calibration, improve
- make sure the final TSC timestamp is reliable too Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r--arch/x86/kernel/tsc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 839070b..6dab90f 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -317,6 +317,12 @@ static unsigned long quick_pit_calibrate(void)
t2 = get_cycles();
/*
+ * Make sure we can rely on the second TSC timestamp:
+ */
+ if (!pit_expect_msb(--expect))
+ goto failed;
+
+ /*
* Ok, if we get here, then we've seen the
* MSB of the PIT decrement QUICK_PIT_ITERATIONS
* times, and each MSB had many hits, so we never
OpenPOWER on IntegriCloud