]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: apic_64 - make calibrate_APIC_clock to return error code
authorCyrill Gorcunov <gorcunov@gmail.com>
Tue, 15 Jul 2008 17:02:54 +0000 (21:02 +0400)
committerIngo Molnar <mingo@elte.hu>
Fri, 18 Jul 2008 12:17:29 +0000 (14:17 +0200)
Make calibration_result to return error and check calibration_result
to be sufficient inside calibrate_APIC_clock.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: macro@linux-mips.org
Cc: yhlu.kernel@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/apic_64.c

index 1e3d32e27c14c23a8d48d1dc6bcf8b30faeefae7..ce294d623e5f05fb11f7f9b23774e7567635b54b 100644 (file)
@@ -314,7 +314,7 @@ static void setup_APIC_timer(void)
 
 #define TICK_COUNT 100000000
 
-static void __init calibrate_APIC_clock(void)
+static int __init calibrate_APIC_clock(void)
 {
        unsigned apic, apic_start;
        unsigned long tsc, tsc_start;
@@ -368,6 +368,17 @@ static void __init calibrate_APIC_clock(void)
                clockevent_delta2ns(0xF, &lapic_clockevent);
 
        calibration_result = result / HZ;
+
+       /*
+        * Do a sanity check on the APIC calibration result
+        */
+       if (calibration_result < (1000000 / HZ)) {
+               printk(KERN_WARNING
+                       "APIC frequency too slow, disabling apic timer\n");
+               return -1;
+       }
+
+       return 0;
 }
 
 /*
@@ -394,14 +405,7 @@ void __init setup_boot_APIC_clock(void)
        }
 
        printk(KERN_INFO "Using local APIC timer interrupts.\n");
-       calibrate_APIC_clock();
-
-       /*
-        * Do a sanity check on the APIC calibration result
-        */
-       if (calibration_result < (1000000 / HZ)) {
-               printk(KERN_WARNING
-                      "APIC frequency too slow, disabling apic timer\n");
+       if (calibrate_APIC_clock()) {
                /* No broadcast on UP ! */
                if (num_possible_cpus() > 1)
                        setup_APIC_timer();