x86: Simplify timer_ack magic in time_32.c
[sfrench/cifs-2.6.git] / arch / x86 / kernel / time_64.c
index 45914f8844a7d19d53de5642e2f6f750c3f5d778..35e0a925da565750556582d38029362f776137c7 100644 (file)
@@ -51,6 +51,20 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
 {
        inc_irq_stat(irq0_irqs);
 
+       /* Optimized out for !IO_APIC and x86_64 */
+       if (timer_ack) {
+               /*
+                * Subtle, when I/O APICs are used we have to ack timer IRQ
+                * manually to deassert NMI lines for the watchdog if run
+                * on an 82489DX-based system.
+                */
+               spin_lock(&i8259A_lock);
+               outb(0x0c, PIC_MASTER_OCW3);
+               /* Ack the IRQ; AEOI will end it automatically. */
+               inb(PIC_MASTER_POLL);
+               spin_unlock(&i8259A_lock);
+       }
+
        global_clock_event->event_handler(global_clock_event);
 
 #ifdef CONFIG_MCA