[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1388707565-16535-34-git-send-email-yinghai@kernel.org>
Date: Thu, 2 Jan 2014 16:06:05 -0800
From: Yinghai Lu <yinghai@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
"H. Peter Anvin" <hpa@...or.com>, Tony Luck <tony.luck@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"Rafael J. Wysocki" <rjw@...k.pl>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org, Rui Wang <rui.y.wang@...el.com>,
Yinghai Lu <yinghai@...nel.org>
Subject: [PATCH v5 33/33] x86, ioapic: Hotadd of IOAPICs described in static MADT
From: Rui Wang <rui.y.wang@...el.com>
For IOAPICs described in static MADT, we already called __mp_register_ioapic()
in arch_early_irq_init(). During boot PCI root hotadd will call it again and
will find it already registered, thus register_ioapic() won't add it to the
ioapic_list. Subsequent hot-removal will also fail because it is not
found on the ioapic_list.
Signed-off-by: Rui Wang <rui.y.wang@...el.com>
Signed-off-by: Yinghai Lu <yinghai@...nel.org>
---
arch/x86/kernel/apic/io_apic.c | 4 +++-
drivers/pci/ioapic.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 248a21d..ad28933 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3964,8 +3964,10 @@ int __mp_register_ioapic(int id, u32 address, u32 gsi_base, bool hotadd)
/* already registered ? */
idx = __mp_find_ioapic(gsi_base);
- if (idx >= 0)
+ if (idx >= 0) {
+ ret = -EEXIST;
goto out;
+ }
idx = find_first_zero_bit(ioapics_mask, MAX_IO_APICS);
if (idx >= MAX_IO_APICS) {
diff --git a/drivers/pci/ioapic.c b/drivers/pci/ioapic.c
index 54de155..0a23295 100644
--- a/drivers/pci/ioapic.c
+++ b/drivers/pci/ioapic.c
@@ -126,7 +126,8 @@ static void handle_ioapic_add(acpi_handle handle, struct pci_dev **pdev,
}
}
- if (acpi_register_ioapic(handle, res->start, gsi_base)) {
+ ret = acpi_register_ioapic(handle, res->start, gsi_base);
+ if (ret && ret != -EEXIST) {
if (dev)
goto exit_release;
return;
--
1.8.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists