aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-06-08 06:00:22 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-07-14 16:32:49 -0400
commit916a0fe739f151664f7f07b42543ae6fd4caec49 (patch)
treed2cd189b463bc998042fd7d02d1f2c365782c9df /arch/x86/kernel/apic
parent890aeacf64c55a7ada7054a140d249ab13899f2d (diff)
x86/ioapic.c: remove #ifdef for 82093AA workaround
While no 64-bit hardware will have a version 0x11 I/O APIC which needs the level/edge bug workaround, that's not a particular reason to use CONFIG_X86_32 to #ifdef the code out. Most 32-bit machines will no longer need the workaround either, so the test to see whether it is necessary should be more fine-grained than "32-bit=yes, 64-bit=no". (Also fix formatting of block comment.) Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r--arch/x86/kernel/apic/io_apic.c47
1 files changed, 19 insertions, 28 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index f8aa5461071b..1a3414442583 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -596,7 +596,6 @@ static void __mask_IO_APIC_irq(struct irq_cfg *cfg)
596 io_apic_modify_irq(cfg, ~0, IO_APIC_REDIR_MASKED, &io_apic_sync); 596 io_apic_modify_irq(cfg, ~0, IO_APIC_REDIR_MASKED, &io_apic_sync);
597} 597}
598 598
599#ifdef CONFIG_X86_32
600static void __mask_and_edge_IO_APIC_irq(struct irq_cfg *cfg) 599static void __mask_and_edge_IO_APIC_irq(struct irq_cfg *cfg)
601{ 600{
602 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_LEVEL_TRIGGER, 601 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_LEVEL_TRIGGER,
@@ -608,7 +607,6 @@ static void __unmask_and_level_IO_APIC_irq(struct irq_cfg *cfg)
608 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_MASKED, 607 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_MASKED,
609 IO_APIC_REDIR_LEVEL_TRIGGER, NULL); 608 IO_APIC_REDIR_LEVEL_TRIGGER, NULL);
610} 609}
611#endif /* CONFIG_X86_32 */
612 610
613static void mask_IO_APIC_irq_desc(struct irq_desc *desc) 611static void mask_IO_APIC_irq_desc(struct irq_desc *desc)
614{ 612{
@@ -2510,11 +2508,8 @@ atomic_t irq_mis_count;
2510static void ack_apic_level(unsigned int irq) 2508static void ack_apic_level(unsigned int irq)
2511{ 2509{
2512 struct irq_desc *desc = irq_to_desc(irq); 2510 struct irq_desc *desc = irq_to_desc(irq);
2513
2514#ifdef CONFIG_X86_32
2515 unsigned long v; 2511 unsigned long v;
2516 int i; 2512 int i;
2517#endif
2518 struct irq_cfg *cfg; 2513 struct irq_cfg *cfg;
2519 int do_unmask_irq = 0; 2514 int do_unmask_irq = 0;
2520 2515
@@ -2527,31 +2522,28 @@ static void ack_apic_level(unsigned int irq)
2527 } 2522 }
2528#endif 2523#endif
2529 2524
2530#ifdef CONFIG_X86_32
2531 /* 2525 /*
2532 * It appears there is an erratum which affects at least version 0x11 2526 * It appears there is an erratum which affects at least version 0x11
2533 * of I/O APIC (that's the 82093AA and cores integrated into various 2527 * of I/O APIC (that's the 82093AA and cores integrated into various
2534 * chipsets). Under certain conditions a level-triggered interrupt is 2528 * chipsets). Under certain conditions a level-triggered interrupt is
2535 * erroneously delivered as edge-triggered one but the respective IRR 2529 * erroneously delivered as edge-triggered one but the respective IRR
2536 * bit gets set nevertheless. As a result the I/O unit expects an EOI 2530 * bit gets set nevertheless. As a result the I/O unit expects an EOI
2537 * message but it will never arrive and further interrupts are blocked 2531 * message but it will never arrive and further interrupts are blocked
2538 * from the source. The exact reason is so far unknown, but the 2532 * from the source. The exact reason is so far unknown, but the
2539 * phenomenon was observed when two consecutive interrupt requests 2533 * phenomenon was observed when two consecutive interrupt requests
2540 * from a given source get delivered to the same CPU and the source is 2534 * from a given source get delivered to the same CPU and the source is
2541 * temporarily disabled in between. 2535 * temporarily disabled in between.
2542 * 2536 *
2543 * A workaround is to simulate an EOI message manually. We achieve it 2537 * A workaround is to simulate an EOI message manually. We achieve it
2544 * by setting the trigger mode to edge and then to level when the edge 2538 * by setting the trigger mode to edge and then to level when the edge
2545 * trigger mode gets detected in the TMR of a local APIC for a 2539 * trigger mode gets detected in the TMR of a local APIC for a
2546 * level-triggered interrupt. We mask the source for the time of the 2540 * level-triggered interrupt. We mask the source for the time of the
2547 * operation to prevent an edge-triggered interrupt escaping meanwhile. 2541 * operation to prevent an edge-triggered interrupt escaping meanwhile.
2548 * The idea is from Manfred Spraul. --macro 2542 * The idea is from Manfred Spraul. --macro
2549 */ 2543 */
2550 cfg = desc->chip_data; 2544 cfg = desc->chip_data;
2551 i = cfg->vector; 2545 i = cfg->vector;
2552
2553 v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1)); 2546 v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
2554#endif
2555 2547
2556 /* 2548 /*
2557 * We must acknowledge the irq before we move it or the acknowledge will 2549 * We must acknowledge the irq before we move it or the acknowledge will
@@ -2593,7 +2585,7 @@ static void ack_apic_level(unsigned int irq)
2593 unmask_IO_APIC_irq_desc(desc); 2585 unmask_IO_APIC_irq_desc(desc);
2594 } 2586 }
2595 2587
2596#ifdef CONFIG_X86_32 2588 /* Tail end of version 0x11 I/O APIC bug workaround */
2597 if (!(v & (1 << (i & 0x1f)))) { 2589 if (!(v & (1 << (i & 0x1f)))) {
2598 atomic_inc(&irq_mis_count); 2590 atomic_inc(&irq_mis_count);
2599 spin_lock(&ioapic_lock); 2591 spin_lock(&ioapic_lock);
@@ -2601,7 +2593,6 @@ static void ack_apic_level(unsigned int irq)
2601 __unmask_and_level_IO_APIC_irq(cfg); 2593 __unmask_and_level_IO_APIC_irq(cfg);
2602 spin_unlock(&ioapic_lock); 2594 spin_unlock(&ioapic_lock);
2603 } 2595 }
2604#endif
2605} 2596}
2606 2597
2607#ifdef CONFIG_INTR_REMAP 2598#ifdef CONFIG_INTR_REMAP