Commit 9a0a91bb authored by Eric W. Biederman's avatar Eric W. Biederman Committed by H. Peter Anvin

x86, acpi/irq: Teach acpi_get_override_irq to take a gsi not an isa_irq

In perverse acpi implementations the isa irqs are not identity mapped
to the first 16 gsi.  Furthermore at least the extended interrupt
resource capability may return gsi's and not isa irqs.  So since
what we get from acpi is a gsi teach acpi_get_overrride_irq to
operate on a gsi instead of an isa_irq.
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
LKML-Reference: <1269936436-7039-2-git-send-email-ebiederm@xmission.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 2c2df841
...@@ -4082,22 +4082,27 @@ int __init io_apic_get_version(int ioapic) ...@@ -4082,22 +4082,27 @@ int __init io_apic_get_version(int ioapic)
return reg_01.bits.version; return reg_01.bits.version;
} }
int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity)
{ {
int i; int ioapic, pin, idx;
if (skip_ioapic_setup) if (skip_ioapic_setup)
return -1; return -1;
for (i = 0; i < mp_irq_entries; i++) ioapic = mp_find_ioapic(gsi);
if (mp_irqs[i].irqtype == mp_INT && if (ioapic < 0)
mp_irqs[i].srcbusirq == bus_irq) return -1;
break;
if (i >= mp_irq_entries) pin = mp_find_ioapic_pin(ioapic, gsi);
if (pin < 0)
return -1;
idx = find_irq_entry(ioapic, pin, mp_INT);
if (idx < 0)
return -1; return -1;
*trigger = irq_trigger(i); *trigger = irq_trigger(idx);
*polarity = irq_polarity(i); *polarity = irq_polarity(idx);
return 0; return 0;
} }
......
...@@ -119,9 +119,9 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); ...@@ -119,9 +119,9 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi); int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
#else #else
#define acpi_get_override_irq(bus, trigger, polarity) (-1) #define acpi_get_override_irq(gsi, trigger, polarity) (-1)
#endif #endif
/* /*
* This function undoes the effect of one call to acpi_register_gsi(). * This function undoes the effect of one call to acpi_register_gsi().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment