Skip to content

Commit 4156e9a

Browse files
author
Ingo Molnar
committed
x86: quick TSC calibration, improve
- make sure the final TSC timestamp is reliable too Signed-off-by: Ingo Molnar <[email protected]>
1 parent 6ac40ed commit 4156e9a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/x86/kernel/tsc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ static unsigned long quick_pit_calibrate(void)
316316
}
317317
t2 = get_cycles();
318318

319+
/*
320+
* Make sure we can rely on the second TSC timestamp:
321+
*/
322+
if (!pit_expect_msb(--expect))
323+
goto failed;
324+
319325
/*
320326
* Ok, if we get here, then we've seen the
321327
* MSB of the PIT decrement QUICK_PIT_ITERATIONS

0 commit comments

Comments
 (0)