diff options
| -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 | } |
