diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2008-05-21 17:09:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 03:12:53 -0400 |
commit | d11d5794e0c21a1054e6cd57381050a999ad7232 (patch) | |
tree | f30e9f4acbfe8ed52be584c0599909ebfa33af4a /arch | |
parent | a0176e2485ce6468f9b74264a2fd6c19811f027a (diff) |
x86: I/O APIC: AEOI timer acknowledgement clean-ups
The code that used to be in do_slow_gettimeoffset() that relied on the
IRR bit of the master 8259A PIC for IRQ0 to check the state of the output
timer 0 of the PIT is no longer there. As a result, there is no need to
use the POLL command to acknowledge the timer interrupt in the "8259A
Virtual Wire", except for the NMI watchdog when the i82489DX APIC is used
(this is because this particular APIC treats NMIs as level-triggered and
keeping the input asserted would keep motherboard NMI sources held off for
too long). Remove the unneeded bits and adjust comments accordingly.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_64.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/nmi_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/time_32.c | 3 |
4 files changed, 13 insertions, 19 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index a40d54fc1fdd..c64b3f5cc121 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -2146,19 +2146,17 @@ static inline void __init check_timer(void) | |||
2146 | set_intr_gate(vector, interrupt[0]); | 2146 | set_intr_gate(vector, interrupt[0]); |
2147 | 2147 | ||
2148 | /* | 2148 | /* |
2149 | * Subtle, code in do_timer_interrupt() expects an AEOI | 2149 | * As IRQ0 is to be enabled in the 8259A, the virtual |
2150 | * mode for the 8259A whenever interrupts are routed | 2150 | * wire has to be disabled in the local APIC. Also |
2151 | * through I/O APICs. Also IRQ0 has to be enabled in | 2151 | * timer interrupts need to be acknowledged manually in |
2152 | * the 8259A which implies the virtual wire has to be | 2152 | * the 8259A for the i82489DX when using the NMI |
2153 | * disabled in the local APIC. Finally timer interrupts | 2153 | * watchdog as that APIC treats NMIs as level-triggered. |
2154 | * need to be acknowledged manually in the 8259A for | 2154 | * The AEOI mode will finish them in the 8259A |
2155 | * timer_interrupt() and for the i82489DX when using | 2155 | * automatically. |
2156 | * the NMI watchdog. | ||
2157 | */ | 2156 | */ |
2158 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); | 2157 | apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); |
2159 | init_8259A(1); | 2158 | init_8259A(1); |
2160 | timer_ack = !cpu_has_tsc; | 2159 | timer_ack = (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver)); |
2161 | timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver)); | ||
2162 | if (timer_over_8254 > 0) | 2160 | if (timer_over_8254 > 0) |
2163 | enable_8259A_irq(0); | 2161 | enable_8259A_irq(0); |
2164 | 2162 | ||
@@ -2219,6 +2217,7 @@ static inline void __init check_timer(void) | |||
2219 | printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); | 2217 | printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); |
2220 | nmi_watchdog = 0; | 2218 | nmi_watchdog = 0; |
2221 | } | 2219 | } |
2220 | timer_ack = 0; | ||
2222 | 2221 | ||
2223 | printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); | 2222 | printk(KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); |
2224 | 2223 | ||
@@ -2237,7 +2236,6 @@ static inline void __init check_timer(void) | |||
2237 | 2236 | ||
2238 | printk(KERN_INFO "...trying to set up timer as ExtINT IRQ..."); | 2237 | printk(KERN_INFO "...trying to set up timer as ExtINT IRQ..."); |
2239 | 2238 | ||
2240 | timer_ack = 0; | ||
2241 | init_8259A(0); | 2239 | init_8259A(0); |
2242 | make_8259A_irq(0); | 2240 | make_8259A_irq(0); |
2243 | apic_write_around(APIC_LVT0, APIC_DM_EXTINT); | 2241 | apic_write_around(APIC_LVT0, APIC_DM_EXTINT); |
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index ef1a8dfcc529..7c34e38e4219 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -1669,11 +1669,8 @@ static inline void __init check_timer(void) | |||
1669 | assign_irq_vector(0, TARGET_CPUS); | 1669 | assign_irq_vector(0, TARGET_CPUS); |
1670 | 1670 | ||
1671 | /* | 1671 | /* |
1672 | * Subtle, code in do_timer_interrupt() expects an AEOI | 1672 | * As IRQ0 is to be enabled in the 8259A, the virtual |
1673 | * mode for the 8259A whenever interrupts are routed | 1673 | * wire has to be disabled in the local APIC. |
1674 | * through I/O APICs. Also IRQ0 has to be enabled in | ||
1675 | * the 8259A which implies the virtual wire has to be | ||
1676 | * disabled in the local APIC. | ||
1677 | */ | 1674 | */ |
1678 | apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); | 1675 | apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); |
1679 | init_8259A(1); | 1676 | init_8259A(1); |
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c index 11b14bbaa61e..d322901c38e6 100644 --- a/arch/x86/kernel/nmi_32.c +++ b/arch/x86/kernel/nmi_32.c | |||
@@ -131,7 +131,7 @@ int __init check_nmi_watchdog(void) | |||
131 | kfree(prev_nmi_count); | 131 | kfree(prev_nmi_count); |
132 | return 0; | 132 | return 0; |
133 | error: | 133 | error: |
134 | timer_ack = !cpu_has_tsc; | 134 | timer_ack = 0; |
135 | 135 | ||
136 | return -1; | 136 | return -1; |
137 | } | 137 | } |
diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c index 2ff21f398934..5f29f12da50c 100644 --- a/arch/x86/kernel/time_32.c +++ b/arch/x86/kernel/time_32.c | |||
@@ -84,8 +84,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
84 | if (timer_ack) { | 84 | if (timer_ack) { |
85 | /* | 85 | /* |
86 | * Subtle, when I/O APICs are used we have to ack timer IRQ | 86 | * Subtle, when I/O APICs are used we have to ack timer IRQ |
87 | * manually to reset the IRR bit for do_slow_gettimeoffset(). | 87 | * manually to deassert NMI lines for the watchdog if run |
88 | * This will also deassert NMI lines for the watchdog if run | ||
89 | * on an 82489DX-based system. | 88 | * on an 82489DX-based system. |
90 | */ | 89 | */ |
91 | spin_lock(&i8259A_lock); | 90 | spin_lock(&i8259A_lock); |