aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 06:44:17 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 03:12:49 -0400
commita0176e2485ce6468f9b74264a2fd6c19811f027a (patch)
tree85e18095b4812b81eaf4400ffeb38f2f9bd8b1c9 /arch
parent1b40a895df6c7d5a80e71f65674060b03d84bbef (diff)
Revert "Revert "x86: fix ioapic bug again""
This reverts commit 0b6a39f7ebcb1c82587ce35b401c513eed41ac5c. The changes in tip/x86/apic solve this better. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/io_apic_32.c12
-rw-r--r--arch/x86/kernel/nmi_32.c9
2 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 4dc8600d9d20..a40d54fc1fdd 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -2130,10 +2130,14 @@ static inline void __init check_timer(void)
2130{ 2130{
2131 int apic1, pin1, apic2, pin2; 2131 int apic1, pin1, apic2, pin2;
2132 int vector; 2132 int vector;
2133 unsigned int ver;
2133 unsigned long flags; 2134 unsigned long flags;
2134 2135
2135 local_irq_save(flags); 2136 local_irq_save(flags);
2136 2137
2138 ver = apic_read(APIC_LVR);
2139 ver = GET_APIC_VERSION(ver);
2140
2137 /* 2141 /*
2138 * get/set the timer IRQ vector: 2142 * get/set the timer IRQ vector:
2139 */ 2143 */
@@ -2146,11 +2150,15 @@ static inline void __init check_timer(void)
2146 * mode for the 8259A whenever interrupts are routed 2150 * mode for the 8259A whenever interrupts are routed
2147 * through I/O APICs. Also IRQ0 has to be enabled in 2151 * through I/O APICs. Also IRQ0 has to be enabled in
2148 * the 8259A which implies the virtual wire has to be 2152 * the 8259A which implies the virtual wire has to be
2149 * disabled in the local APIC. 2153 * disabled in the local APIC. Finally timer interrupts
2154 * need to be acknowledged manually in the 8259A for
2155 * timer_interrupt() and for the i82489DX when using
2156 * the NMI watchdog.
2150 */ 2157 */
2151 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2158 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
2152 init_8259A(1); 2159 init_8259A(1);
2153 timer_ack = 1; 2160 timer_ack = !cpu_has_tsc;
2161 timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
2154 if (timer_over_8254 > 0) 2162 if (timer_over_8254 > 0)
2155 enable_8259A_irq(0); 2163 enable_8259A_irq(0);
2156 2164
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index 84160f74eeb0..11b14bbaa61e 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -26,6 +26,7 @@
26 26
27#include <asm/smp.h> 27#include <asm/smp.h>
28#include <asm/nmi.h> 28#include <asm/nmi.h>
29#include <asm/timer.h>
29 30
30#include "mach_traps.h" 31#include "mach_traps.h"
31 32
@@ -81,7 +82,7 @@ int __init check_nmi_watchdog(void)
81 82
82 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL); 83 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
83 if (!prev_nmi_count) 84 if (!prev_nmi_count)
84 return -1; 85 goto error;
85 86
86 printk(KERN_INFO "Testing NMI watchdog ... "); 87 printk(KERN_INFO "Testing NMI watchdog ... ");
87 88
@@ -118,7 +119,7 @@ int __init check_nmi_watchdog(void)
118 if (!atomic_read(&nmi_active)) { 119 if (!atomic_read(&nmi_active)) {
119 kfree(prev_nmi_count); 120 kfree(prev_nmi_count);
120 atomic_set(&nmi_active, -1); 121 atomic_set(&nmi_active, -1);
121 return -1; 122 goto error;
122 } 123 }
123 printk("OK.\n"); 124 printk("OK.\n");
124 125
@@ -129,6 +130,10 @@ int __init check_nmi_watchdog(void)
129 130
130 kfree(prev_nmi_count); 131 kfree(prev_nmi_count);
131 return 0; 132 return 0;
133error:
134 timer_ack = !cpu_has_tsc;
135
136 return -1;
132} 137}
133 138
134static int __init setup_nmi_watchdog(char *str) 139static int __init setup_nmi_watchdog(char *str)