Skip to content

Commit

Permalink
x86: quick TSC calibration, improve
Browse files Browse the repository at this point in the history
- make sure the final TSC timestamp is reliable too

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Sep 4, 2008
1 parent 6ac40ed commit 4156e9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/x86/kernel/tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,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
Expand Down

0 comments on commit 4156e9a

Please sign in to comment.