Revert "x86: fix ioapic bug again"

This reverts commit 6e908947b4995bc0e551a8257c586d5c3e428201.

Németh Márton reported:

| there is a problem in 2.6.26-rc3 which was not there in case of
| 2.6.25: the CPU wakes up ~90,000 times per sec instead of ~60 per sec.
|
| I also "git bisected" the problem, the result is:
|
| 6e908947b4995bc0e551a8257c586d5c3e428201 is first bad commit
| commit 6e908947b4995bc0e551a8257c586d5c3e428201
| Author: Ingo Molnar <mingo@elte.hu>
| Date: Fri Mar 21 14:32:36 2008 +0100
|
| x86: fix ioapic bug again

the original problem is fixed by Maciej W. Rozycki in the tip/x86/apic
branch (confirmed by Márton), but those changes are too intrusive for
v2.6.26 so we'll go for the less intrusive (repeated) revert now.

Reported-and-bisected-by: Németh Márton <nm127@freemail.hu>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

+4 -17
+2 -10
arch/x86/kernel/io_apic_32.c
··· 2130 { 2131 int apic1, pin1, apic2, pin2; 2132 int vector; 2133 - unsigned int ver; 2134 unsigned long flags; 2135 2136 local_irq_save(flags); 2137 - 2138 - ver = apic_read(APIC_LVR); 2139 - ver = GET_APIC_VERSION(ver); 2140 2141 /* 2142 * get/set the timer IRQ vector: ··· 2146 * mode for the 8259A whenever interrupts are routed 2147 * through I/O APICs. Also IRQ0 has to be enabled in 2148 * the 8259A which implies the virtual wire has to be 2149 - * disabled in the local APIC. Finally timer interrupts 2150 - * need to be acknowledged manually in the 8259A for 2151 - * timer_interrupt() and for the i82489DX when using 2152 - * the NMI watchdog. 2153 */ 2154 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2155 init_8259A(1); 2156 - timer_ack = !cpu_has_tsc; 2157 - timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver)); 2158 if (timer_over_8254 > 0) 2159 enable_8259A_irq(0); 2160
··· 2130 { 2131 int apic1, pin1, apic2, pin2; 2132 int vector; 2133 unsigned long flags; 2134 2135 local_irq_save(flags); 2136 2137 /* 2138 * get/set the timer IRQ vector: ··· 2150 * mode for the 8259A whenever interrupts are routed 2151 * through I/O APICs. Also IRQ0 has to be enabled in 2152 * the 8259A which implies the virtual wire has to be 2153 + * disabled in the local APIC. 2154 */ 2155 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2156 init_8259A(1); 2157 + timer_ack = 1; 2158 if (timer_over_8254 > 0) 2159 enable_8259A_irq(0); 2160
+2 -7
arch/x86/kernel/nmi_32.c
··· 26 27 #include <asm/smp.h> 28 #include <asm/nmi.h> 29 - #include <asm/timer.h> 30 31 #include "mach_traps.h" 32 ··· 81 82 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL); 83 if (!prev_nmi_count) 84 - goto error; 85 86 printk(KERN_INFO "Testing NMI watchdog ... "); 87 ··· 118 if (!atomic_read(&nmi_active)) { 119 kfree(prev_nmi_count); 120 atomic_set(&nmi_active, -1); 121 - goto error; 122 } 123 printk("OK.\n"); 124 ··· 129 130 kfree(prev_nmi_count); 131 return 0; 132 - error: 133 - timer_ack = !cpu_has_tsc; 134 - 135 - return -1; 136 } 137 138 static int __init setup_nmi_watchdog(char *str)
··· 26 27 #include <asm/smp.h> 28 #include <asm/nmi.h> 29 30 #include "mach_traps.h" 31 ··· 82 83 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL); 84 if (!prev_nmi_count) 85 + return -1; 86 87 printk(KERN_INFO "Testing NMI watchdog ... "); 88 ··· 119 if (!atomic_read(&nmi_active)) { 120 kfree(prev_nmi_count); 121 atomic_set(&nmi_active, -1); 122 + return -1; 123 } 124 printk("OK.\n"); 125 ··· 130 131 kfree(prev_nmi_count); 132 return 0; 133 } 134 135 static int __init setup_nmi_watchdog(char *str)