[PATCH 7/8] x86: I/O APIC: Clean up the 8259A on a NMI watchdog failure

Previous thread: [PATCH 6/8] x86: APIC/SMP: Downgrade the NMI watchdog for "nosmp" by Maciej W. Rozycki on Wednesday, May 21, 2008 - 2:10 pm. (1 message)

Next thread: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance by Maciej W. Rozycki on Wednesday, May 21, 2008 - 2:10 pm. (2 messages)
From: Maciej W. Rozycki
Date: Wednesday, May 21, 2008 - 2:10 pm

There is no point in keeping the 8259A enabled if the I/O APIC NMI 
watchdog has failed and the 8259A is not used to pass through regular 
timer interrupts.  This fixes problems with some systems where some logic 
gets confused.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
patch-2.6.26-rc1-20080505-timer-8259-6
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_32.c linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_32.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_32.c	2008-05-21 18:52:36.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_32.c	2008-05-21 18:52:36.000000000 +0000
@@ -58,6 +58,7 @@ static struct { int pin, apic; } ioapic_
 static DEFINE_SPINLOCK(ioapic_lock);
 static DEFINE_SPINLOCK(vector_lock);
 
+int timer_through_8259 __initdata;
 
 /*
  *	Is the SiS APIC rmw bug present ?
@@ -2194,6 +2195,7 @@ static inline void __init check_timer(vo
 		enable_8259A_irq(0);
 		if (timer_irq_works()) {
 			printk("works.\n");
+			timer_through_8259 = 1;
 			if (pin1 != -1)
 				replace_pin_at_irq(0, apic1, pin1, apic2, pin2);
 			else
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/io_apic_64.c	2008-05-18 00:24:43.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/io_apic_64.c	2008-05-18 00:24:43.000000000 +0000
@@ -90,6 +90,7 @@ static int no_timer_check;
 
 static int disable_timer_pin_1 __initdata;
 
+int timer_through_8259 __initdata;
 
 /* Where if anywhere is the i8259 connect in external int mode */
 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
@@ -1700,6 +1701,7 @@ static inline void __init check_timer(vo
 		enable_8259A_irq(0);
 		if (timer_irq_works()) {
 			apic_printk(APIC_VERBOSE," works.\n");
+			timer_through_8259 = 1;
 			nmi_watchdog_default();
 			if (nmi_watchdog == NMI_IO_APIC) {
 ...
Previous thread: [PATCH 6/8] x86: APIC/SMP: Downgrade the NMI watchdog for "nosmp" by Maciej W. Rozycki on Wednesday, May 21, 2008 - 2:10 pm. (1 message)

Next thread: [PATCH 8/8] x86: I/O APIC: Timer through 8259A second-chance by Maciej W. Rozycki on Wednesday, May 21, 2008 - 2:10 pm. (2 messages)