aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/acpi/boot.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 6ddeba31bd98..2d76f022adc2 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -76,6 +76,19 @@ int acpi_fix_pin2_polarity __initdata;
76static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; 76static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
77#endif 77#endif
78 78
79/*
80 * Locks related to IOAPIC hotplug
81 * Hotplug side:
82 * ->device_hotplug_lock
83 * ->acpi_ioapic_lock
84 * ->ioapic_lock
85 * Interrupt mapping side:
86 * ->acpi_ioapic_lock
87 * ->ioapic_mutex
88 * ->ioapic_lock
89 */
90static DEFINE_MUTEX(acpi_ioapic_lock);
91
79/* -------------------------------------------------------------------------- 92/* --------------------------------------------------------------------------
80 Boot-time Configuration 93 Boot-time Configuration
81 -------------------------------------------------------------------------- */ 94 -------------------------------------------------------------------------- */
@@ -609,8 +622,10 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
609 if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) { 622 if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
610 *irqp = gsi; 623 *irqp = gsi;
611 } else { 624 } else {
625 mutex_lock(&acpi_ioapic_lock);
612 irq = mp_map_gsi_to_irq(gsi, 626 irq = mp_map_gsi_to_irq(gsi,
613 IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK); 627 IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK);
628 mutex_unlock(&acpi_ioapic_lock);
614 if (irq < 0) 629 if (irq < 0)
615 return -1; 630 return -1;
616 *irqp = irq; 631 *irqp = irq;
@@ -650,7 +665,9 @@ static int acpi_register_gsi_ioapic(struct device *dev, u32 gsi,
650 int irq = gsi; 665 int irq = gsi;
651 666
652#ifdef CONFIG_X86_IO_APIC 667#ifdef CONFIG_X86_IO_APIC
668 mutex_lock(&acpi_ioapic_lock);
653 irq = mp_register_gsi(dev, gsi, trigger, polarity); 669 irq = mp_register_gsi(dev, gsi, trigger, polarity);
670 mutex_unlock(&acpi_ioapic_lock);
654#endif 671#endif
655 672
656 return irq; 673 return irq;
@@ -659,7 +676,9 @@ static int acpi_register_gsi_ioapic(struct device *dev, u32 gsi,
659static void acpi_unregister_gsi_ioapic(u32 gsi) 676static void acpi_unregister_gsi_ioapic(u32 gsi)
660{ 677{
661#ifdef CONFIG_X86_IO_APIC 678#ifdef CONFIG_X86_IO_APIC
679 mutex_lock(&acpi_ioapic_lock);
662 mp_unregister_gsi(gsi); 680 mp_unregister_gsi(gsi);
681 mutex_unlock(&acpi_ioapic_lock);
663#endif 682#endif
664} 683}
665 684
@@ -1187,7 +1206,9 @@ static void __init acpi_process_madt(void)
1187 /* 1206 /*
1188 * Parse MADT IO-APIC entries 1207 * Parse MADT IO-APIC entries
1189 */ 1208 */
1209 mutex_lock(&acpi_ioapic_lock);
1190 error = acpi_parse_madt_ioapic_entries(); 1210 error = acpi_parse_madt_ioapic_entries();
1211 mutex_unlock(&acpi_ioapic_lock);
1191 if (!error) { 1212 if (!error) {
1192 acpi_set_irq_model_ioapic(); 1213 acpi_set_irq_model_ioapic();
1193 1214