diff options
| -rw-r--r-- | arch/x86/kernel/apic_64.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 1e3d32e27c14..ce294d623e5f 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
| @@ -314,7 +314,7 @@ static void setup_APIC_timer(void) | |||
| 314 | 314 | ||
| 315 | #define TICK_COUNT 100000000 | 315 | #define TICK_COUNT 100000000 |
| 316 | 316 | ||
| 317 | static void __init calibrate_APIC_clock(void) | 317 | static int __init calibrate_APIC_clock(void) |
| 318 | { | 318 | { |
| 319 | unsigned apic, apic_start; | 319 | unsigned apic, apic_start; |
| 320 | unsigned long tsc, tsc_start; | 320 | unsigned long tsc, tsc_start; |
| @@ -368,6 +368,17 @@ static void __init calibrate_APIC_clock(void) | |||
| 368 | clockevent_delta2ns(0xF, &lapic_clockevent); | 368 | clockevent_delta2ns(0xF, &lapic_clockevent); |
| 369 | 369 | ||
| 370 | calibration_result = result / HZ; | 370 | calibration_result = result / HZ; |
| 371 | |||
| 372 | /* | ||
| 373 | * Do a sanity check on the APIC calibration result | ||
| 374 | */ | ||
| 375 | if (calibration_result < (1000000 / HZ)) { | ||
| 376 | printk(KERN_WARNING | ||
| 377 | "APIC frequency too slow, disabling apic timer\n"); | ||
| 378 | return -1; | ||
| 379 | } | ||
| 380 | |||
| 381 | return 0; | ||
| 371 | } | 382 | } |
| 372 | 383 | ||
| 373 | /* | 384 | /* |
| @@ -394,14 +405,7 @@ void __init setup_boot_APIC_clock(void) | |||
| 394 | } | 405 | } |
| 395 | 406 | ||
| 396 | printk(KERN_INFO "Using local APIC timer interrupts.\n"); | 407 | printk(KERN_INFO "Using local APIC timer interrupts.\n"); |
| 397 | calibrate_APIC_clock(); | 408 | if (calibrate_APIC_clock()) { |
| 398 | |||
| 399 | /* | ||
| 400 | * Do a sanity check on the APIC calibration result | ||
| 401 | */ | ||
| 402 | if (calibration_result < (1000000 / HZ)) { | ||
| 403 | printk(KERN_WARNING | ||
| 404 | "APIC frequency too slow, disabling apic timer\n"); | ||
| 405 | /* No broadcast on UP ! */ | 409 | /* No broadcast on UP ! */ |
| 406 | if (num_possible_cpus() > 1) | 410 | if (num_possible_cpus() > 1) |
| 407 | setup_APIC_timer(); | 411 | setup_APIC_timer(); |
