aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-03-30 04:07:13 -0400
committerH. Peter Anvin <hpa@zytor.com>2010-05-04 16:35:08 -0400
commitd464207c4fdd70c2a0febd4f9c58206fa915bb36 (patch)
treef0fe275977391a5b7bb7edd839fd15c9b693bd5d /arch
parent7716a5c4ff5f1f3dc5e9edcab125cbf7fceef0af (diff)
x86, ioapic: Optimize pin_2_irq
Now that all ioapics have valid gsi_base values use this to accellerate pin_2_irq. In the case of acpi this also ensures that pin_2_irq will compute the same irq value for an ioapic pin as acpi will. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> LKML-Reference: <1269936436-7039-12-git-send-email-ebiederm@xmission.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/apic/io_apic.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index dae9240bd287..0d35f46929d1 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1019,7 +1019,7 @@ static inline int irq_trigger(int idx)
1019int (*ioapic_renumber_irq)(int ioapic, int irq); 1019int (*ioapic_renumber_irq)(int ioapic, int irq);
1020static int pin_2_irq(int idx, int apic, int pin) 1020static int pin_2_irq(int idx, int apic, int pin)
1021{ 1021{
1022 int irq, i; 1022 int irq;
1023 int bus = mp_irqs[idx].srcbus; 1023 int bus = mp_irqs[idx].srcbus;
1024 1024
1025 /* 1025 /*
@@ -1031,18 +1031,13 @@ static int pin_2_irq(int idx, int apic, int pin)
1031 if (test_bit(bus, mp_bus_not_pci)) { 1031 if (test_bit(bus, mp_bus_not_pci)) {
1032 irq = mp_irqs[idx].srcbusirq; 1032 irq = mp_irqs[idx].srcbusirq;
1033 } else { 1033 } else {
1034 /* 1034 u32 gsi = mp_gsi_routing[apic].gsi_base + pin;
1035 * PCI IRQs are mapped in order
1036 */
1037 i = irq = 0;
1038 while (i < apic)
1039 irq += nr_ioapic_registers[i++];
1040 irq += pin;
1041 /* 1035 /*
1042 * For MPS mode, so far only needed by ES7000 platform 1036 * For MPS mode, so far only needed by ES7000 platform
1043 */ 1037 */
1044 if (ioapic_renumber_irq) 1038 if (ioapic_renumber_irq)
1045 irq = ioapic_renumber_irq(apic, irq); 1039 gsi = ioapic_renumber_irq(apic, gsi);
1040 irq = gsi;
1046 } 1041 }
1047 1042
1048#ifdef CONFIG_X86_32 1043#ifdef CONFIG_X86_32