diff options
author | Weidong Han <weidong.han@intel.com> | 2009-04-17 04:42:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-19 04:21:33 -0400 |
commit | 5d0ae2db6deac4f15dac4f42f23bc56448fc8d4d (patch) | |
tree | 6f823dfb3cdf43dcf0f41f4e6b7297daa6742d0f /arch/x86/kernel/apic/io_apic.c | |
parent | 2b2fd87a6ef56ba7647a578e81bb8c8efda166b8 (diff) |
x86, intr-remap: fix ack for interrupt remapping
Shouldn't call ack_apic_edge() in ir_ack_apic_edge(), because
ack_apic_edge() does more than just ack: it also does irq migration
in the non-interrupt-remapping case. But there is no such need for
interrupt-remapping case, as irq migration is done in the process
context.
Similarly, ir_ack_apic_level() shouldn't call ack_apic_level, and
instead should do the local cpu's EOI + directed EOI to the io-apic.
ack_x2APIC_irq() is not neccessary, because ack_APIC_irq() will use MSR
write for x2apic, and uncached write for non-x2apic.
[ Impact: simplify/standardize intr-remap IRQ acking, fix on !x2apic ]
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: iommu@lists.linux-foundation.org
Cc: allen.m.kay@intel.com
Cc: fenghua.yu@intel.com
LKML-Reference: <1239957736-6161-3-git-send-email-weidong.han@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 849900022407..ea22a86e3cda 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2552,20 +2552,6 @@ eoi_ioapic_irq(struct irq_desc *desc) | |||
2552 | spin_unlock_irqrestore(&ioapic_lock, flags); | 2552 | spin_unlock_irqrestore(&ioapic_lock, flags); |
2553 | } | 2553 | } |
2554 | 2554 | ||
2555 | #ifdef CONFIG_X86_X2APIC | ||
2556 | static void ack_x2apic_level(unsigned int irq) | ||
2557 | { | ||
2558 | struct irq_desc *desc = irq_to_desc(irq); | ||
2559 | ack_x2APIC_irq(); | ||
2560 | eoi_ioapic_irq(desc); | ||
2561 | } | ||
2562 | |||
2563 | static void ack_x2apic_edge(unsigned int irq) | ||
2564 | { | ||
2565 | ack_x2APIC_irq(); | ||
2566 | } | ||
2567 | #endif | ||
2568 | |||
2569 | static void ack_apic_edge(unsigned int irq) | 2555 | static void ack_apic_edge(unsigned int irq) |
2570 | { | 2556 | { |
2571 | struct irq_desc *desc = irq_to_desc(irq); | 2557 | struct irq_desc *desc = irq_to_desc(irq); |
@@ -2629,9 +2615,6 @@ static void ack_apic_level(unsigned int irq) | |||
2629 | */ | 2615 | */ |
2630 | ack_APIC_irq(); | 2616 | ack_APIC_irq(); |
2631 | 2617 | ||
2632 | if (irq_remapped(irq)) | ||
2633 | eoi_ioapic_irq(desc); | ||
2634 | |||
2635 | /* Now we can move and renable the irq */ | 2618 | /* Now we can move and renable the irq */ |
2636 | if (unlikely(do_unmask_irq)) { | 2619 | if (unlikely(do_unmask_irq)) { |
2637 | /* Only migrate the irq if the ack has been received. | 2620 | /* Only migrate the irq if the ack has been received. |
@@ -2680,20 +2663,15 @@ static void ack_apic_level(unsigned int irq) | |||
2680 | #ifdef CONFIG_INTR_REMAP | 2663 | #ifdef CONFIG_INTR_REMAP |
2681 | static void ir_ack_apic_edge(unsigned int irq) | 2664 | static void ir_ack_apic_edge(unsigned int irq) |
2682 | { | 2665 | { |
2683 | #ifdef CONFIG_X86_X2APIC | 2666 | ack_APIC_irq(); |
2684 | if (x2apic_enabled()) | ||
2685 | return ack_x2apic_edge(irq); | ||
2686 | #endif | ||
2687 | return ack_apic_edge(irq); | ||
2688 | } | 2667 | } |
2689 | 2668 | ||
2690 | static void ir_ack_apic_level(unsigned int irq) | 2669 | static void ir_ack_apic_level(unsigned int irq) |
2691 | { | 2670 | { |
2692 | #ifdef CONFIG_X86_X2APIC | 2671 | struct irq_desc *desc = irq_to_desc(irq); |
2693 | if (x2apic_enabled()) | 2672 | |
2694 | return ack_x2apic_level(irq); | 2673 | ack_APIC_irq(); |
2695 | #endif | 2674 | eoi_ioapic_irq(desc); |
2696 | return ack_apic_level(irq); | ||
2697 | } | 2675 | } |
2698 | #endif /* CONFIG_INTR_REMAP */ | 2676 | #endif /* CONFIG_INTR_REMAP */ |
2699 | 2677 | ||