]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/i386/kernel/apic.c
[PATCH] i386: LVT entries remaining unmasked on reboot
[linux-2.6-omap-h63xx.git] / arch / i386 / kernel / apic.c
index 5546ddebec33dc994c93b5f3f604867da4e94413..496a2c9909fe71d6c502e00683239183f08e72cc 100644 (file)
@@ -559,14 +559,20 @@ void __devinit setup_local_APIC(void)
  * If Linux enabled the LAPIC against the BIOS default
  * disable it down before re-entering the BIOS on shutdown.
  * Otherwise the BIOS may get confused and not power-off.
+ * Additionally clear all LVT entries before disable_local_APIC
+ * for the case where Linux didn't enable the LAPIC.
  */
 void lapic_shutdown(void)
 {
-       if (!cpu_has_apic || !enabled_via_apicbase)
+       if (!cpu_has_apic)
                return;
 
        local_irq_disable();
-       disable_local_APIC();
+       clear_local_APIC();
+
+       if (enabled_via_apicbase)
+               disable_local_APIC();
+
        local_irq_enable();
 }
 
@@ -1046,10 +1052,11 @@ static unsigned int calibration_result;
 
 void __init setup_boot_APIC_clock(void)
 {
+       unsigned long flags;
        apic_printk(APIC_VERBOSE, "Using local APIC timer interrupts.\n");
        using_apic_timer = 1;
 
-       local_irq_disable();
+       local_irq_save(flags);
 
        calibration_result = calibrate_APIC_clock();
        /*
@@ -1057,7 +1064,7 @@ void __init setup_boot_APIC_clock(void)
         */
        setup_APIC_timer(calibration_result);
 
-       local_irq_enable();
+       local_irq_restore(flags);
 }
 
 void __devinit setup_secondary_APIC_clock(void)