diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-07-31 10:23:35 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-07-31 10:23:35 +0200 |
commit | 5b929bd11df23922daf1be5d52731cc3900c1d79 (patch) | |
tree | 105fa5987b03c9f4e0260a9eb04dff7bb3d16839 /arch/x86/kernel/tsc.c | |
parent | b2c51106c7581866c37ffc77c5d739f3d4b7cbc9 (diff) | |
parent | 37868fe113ff2ba814b3b4eb12df214df555f8dc (diff) | |
download | blackbird-obmc-linux-5b929bd11df23922daf1be5d52731cc3900c1d79.tar.gz blackbird-obmc-linux-5b929bd11df23922daf1be5d52731cc3900c1d79.zip |
Merge branch 'x86/urgent' into x86/asm, before applying dependent patches
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r-- | arch/x86/kernel/tsc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 451bade0d320..1bb8bab1b3cb 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -592,10 +592,19 @@ static unsigned long quick_pit_calibrate(void) if (!pit_expect_msb(0xff-i, &delta, &d2)) break; + delta -= tsc; + + /* + * Extrapolate the error and fail fast if the error will + * never be below 500 ppm. + */ + if (i == 1 && + d1 + d2 >= (delta * MAX_QUICK_PIT_ITERATIONS) >> 11) + return 0; + /* * Iterate until the error is less than 500 ppm */ - delta -= tsc; if (d1+d2 >= delta >> 11) continue; |