diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2010-03-30 04:07:06 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-05-04 16:34:38 -0400 |
commit | 0fd52670fb6400be0996ac492b5ed77f3d83d69a (patch) | |
tree | 72b240783b05b6cd1536a2b445d3bb841229491a | |
parent | 9d2062b879495649bb525cf7979126da2e45d288 (diff) |
x86, acpi/irq: Generalize mp_config_acpi_legacy_irqs
Remove the assumption that there is not an override for isa irq 0.
Instead lookup the gsi and from that lookup the ioapic and pin of each
isa irq indivdually.
In general this should not have any behavioural affect but in
perverse cases this gets all of the details correct, instead of
doing something weird.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
LKML-Reference: <1269936436-7039-5-git-send-email-ebiederm@xmission.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 0a036dc6f9ff..3ee92f28a4b2 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -961,8 +961,6 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) | |||
961 | void __init mp_config_acpi_legacy_irqs(void) | 961 | void __init mp_config_acpi_legacy_irqs(void) |
962 | { | 962 | { |
963 | int i; | 963 | int i; |
964 | int ioapic; | ||
965 | unsigned int dstapic; | ||
966 | struct mpc_intsrc mp_irq; | 964 | struct mpc_intsrc mp_irq; |
967 | 965 | ||
968 | #if defined (CONFIG_MCA) || defined (CONFIG_EISA) | 966 | #if defined (CONFIG_MCA) || defined (CONFIG_EISA) |
@@ -983,19 +981,27 @@ void __init mp_config_acpi_legacy_irqs(void) | |||
983 | #endif | 981 | #endif |
984 | 982 | ||
985 | /* | 983 | /* |
986 | * Locate the IOAPIC that manages the ISA IRQs (0-15). | ||
987 | */ | ||
988 | ioapic = mp_find_ioapic(0); | ||
989 | if (ioapic < 0) | ||
990 | return; | ||
991 | dstapic = mp_ioapics[ioapic].apicid; | ||
992 | |||
993 | /* | ||
994 | * Use the default configuration for the IRQs 0-15. Unless | 984 | * Use the default configuration for the IRQs 0-15. Unless |
995 | * overridden by (MADT) interrupt source override entries. | 985 | * overridden by (MADT) interrupt source override entries. |
996 | */ | 986 | */ |
997 | for (i = 0; i < 16; i++) { | 987 | for (i = 0; i < 16; i++) { |
988 | int ioapic, pin; | ||
989 | unsigned int dstapic; | ||
998 | int idx; | 990 | int idx; |
991 | u32 gsi; | ||
992 | |||
993 | /* Locate the gsi that irq i maps to. */ | ||
994 | if (acpi_isa_irq_to_gsi(i, &gsi)) | ||
995 | continue; | ||
996 | |||
997 | /* | ||
998 | * Locate the IOAPIC that manages the ISA IRQ. | ||
999 | */ | ||
1000 | ioapic = mp_find_ioapic(gsi); | ||
1001 | if (ioapic < 0) | ||
1002 | continue; | ||
1003 | pin = mp_find_ioapic_pin(ioapic, gsi); | ||
1004 | dstapic = mp_ioapics[ioapic].apicid; | ||
999 | 1005 | ||
1000 | for (idx = 0; idx < mp_irq_entries; idx++) { | 1006 | for (idx = 0; idx < mp_irq_entries; idx++) { |
1001 | struct mpc_intsrc *irq = mp_irqs + idx; | 1007 | struct mpc_intsrc *irq = mp_irqs + idx; |
@@ -1005,7 +1011,7 @@ void __init mp_config_acpi_legacy_irqs(void) | |||
1005 | break; | 1011 | break; |
1006 | 1012 | ||
1007 | /* Do we already have a mapping for this IOAPIC pin */ | 1013 | /* Do we already have a mapping for this IOAPIC pin */ |
1008 | if (irq->dstapic == dstapic && irq->dstirq == i) | 1014 | if (irq->dstapic == dstapic && irq->dstirq == pin) |
1009 | break; | 1015 | break; |
1010 | } | 1016 | } |
1011 | 1017 | ||
@@ -1020,7 +1026,7 @@ void __init mp_config_acpi_legacy_irqs(void) | |||
1020 | mp_irq.dstapic = dstapic; | 1026 | mp_irq.dstapic = dstapic; |
1021 | mp_irq.irqtype = mp_INT; | 1027 | mp_irq.irqtype = mp_INT; |
1022 | mp_irq.srcbusirq = i; /* Identity mapped */ | 1028 | mp_irq.srcbusirq = i; /* Identity mapped */ |
1023 | mp_irq.dstirq = i; | 1029 | mp_irq.dstirq = pin; |
1024 | 1030 | ||
1025 | save_mp_irq(&mp_irq); | 1031 | save_mp_irq(&mp_irq); |
1026 | } | 1032 | } |