Skip to contentSkip to conversation

x86/ioapic: Ignore root bridges without a companion ACPI device

PATCH In review Rui Wang 5 participants 6 messages Sep 10, 2016 – Sep 12, 2016

Subsystems (2)
lore
Share & tools
lore

Rui Wang

author
#0 lore raw

PATCH 1/1 x86/ioapic: Ignore root bridges without a companion ACPI device

Some PCI root bridges don't have a corresponding ACPI device. This can be the case on some old platforms. Don't call acpi_ioapic_add() on these bridges because they can't support ioapic hotplug.

v2: Per Boris's review, removed the unnecessary local var; refined comment

---
 drivers/pci/setup-bus.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pci/setup-bus.c +4 -1
index ec538d3..8b4e231 100644
@@ -1855,7 +1855,10 @@ void __init pci_assign_unassigned_resources(void)
 
 	list_for_each_entry(root_bus, &pci_root_buses, node) {
 		pci_assign_unassigned_root_bus_resources(root_bus);
-		acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge));
+
+		/* make sure the root bridge has a companion ACPI device */
+		if (ACPI_HANDLE(root_bus->bridge))
+			acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge));
 	}
 }
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 18 lines · Rui Wang

Some PCI root bridges don't have a corresponding ACPI device. This can be the case on some old platforms. Don't call acpi_ioapic_add() on these bridges because they can't support ioapic hotplug.

v2: Per Boris's review, removed the unnecessary local var; refined comment

---
 drivers/pci/setup-bus.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pci/setup-bus.c +0 -0
index ec538d3..8b4e231 100644

drivers/pci/setup-bus.c void __init pci_assign_unassigned_resources(void) · line 1861

Quoted 8 lines
drivers/pci/setup-bus.c +4 -1
@@ -1855,7 +1855,10 @@ void __init pci_assign_unassigned_resources(void)
 
 	list_for_each_entry(root_bus, &pci_root_buses, node) {
 		pci_assign_unassigned_root_bus_resources(root_bus);
-		acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge));
+
+		/* make sure the root bridge has a companion ACPI device */
+		if (ACPI_HANDLE(root_bus->bridge))
+			acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge));

Thanks Rui!

Signature · 4 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
#2 lore raw
In reply to Rui Wang
x86/ioapic: Ignore root bridges without a companion ACPI device
Commit-ID:  d9c149d6ce1a94de578a4e323f6881fcb6b986ab
Gitweb:     http://git.kernel.org/tip/d9c149d6ce1a94de578a4e323f6881fcb6b986ab
Author:     Rui Wang <[email protected]>
AuthorDate: Sat, 10 Sep 2016 23:40:45 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 10 Sep 2016 20:30:31 +0200

x86/ioapic: Ignore root bridges without a companion ACPI device

Some PCI root bridges don't have a corresponding ACPI device. This can be the case on some old platforms. Don't call acpi_ioapic_add() on these bridges because they can't support ioapic hotplug.

---
 drivers/pci/setup-bus.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pci/setup-bus.c +4 -1
index ec538d3..f30ca75 100644
@@ -1855,7 +1855,10 @@ void __init pci_assign_unassigned_resources(void)
 
 	list_for_each_entry(root_bus, &pci_root_buses, node) {
 		pci_assign_unassigned_root_bus_resources(root_bus);
-		acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge));
+
+		/* Make sure the root bridge has a companion ACPI device: */
+		if (ACPI_HANDLE(root_bus->bridge))
+			acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge));
 	}
 }
 
#3 lore raw
In reply to Rui Wang
Quoted 3 lines · Rui Wang

Some PCI root bridges don't have a corresponding ACPI device. This can be the case on some old platforms. Don't call acpi_ioapic_add() on these bridges because they can't support ioapic hotplug.

Not just old platforms. VMD is a new device which initializes a root port in software without an acpi handle.

What branch is this based on? I can't find the relevant code/commits

#4 lore raw
Quoted 1 line

What branch is this based on? I can't find the relevant code/commits

tip tree. branch x86/apic

-Tony

#5 lore raw
Quoted 5 lines · Tony
Quoted 1 line

What branch is this based on? I can't find the relevant code/commits

tip tree. branch x86/apic

-Tony

Cheers!