diff mbox

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

Message ID 1473522046-31329-1-git-send-email-rui.y.wang@intel.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Wang, Rui Y Sept. 10, 2016, 3:40 p.m. UTC
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

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
Reviewed-by: Borislav Petkov <bp@alien8.de>
---
 drivers/pci/setup-bus.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Borislav Petkov Sept. 10, 2016, 5:27 p.m. UTC | #1
On Sat, Sep 10, 2016 at 11:40:45PM +0800, Rui Wang wrote:
> 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
> 
> Signed-off-by: Rui Wang <rui.y.wang@intel.com>
> Reviewed-by: Borislav Petkov <bp@alien8.de>
>
> ---
>  drivers/pci/setup-bus.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index ec538d3..8b4e231 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -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));

Reported-and-tested-by: Borislav Petkov <bp@suse.de>

Thanks Rui!
Jon Derrick Sept. 12, 2016, 9:25 p.m. UTC | #2
On Sat, Sep 10, 2016 at 11:40:45PM +0800, Rui Wang wrote:
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Luck, Tony Sept. 12, 2016, 9:43 p.m. UTC | #3
> What branch is this based on? I can't find the relevant code/commits

tip tree. branch x86/apic

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jon Derrick Sept. 12, 2016, 9:46 p.m. UTC | #4
On Mon, Sep 12, 2016 at 03:43:23PM -0600, Luck, Tony wrote:
> > What branch is this based on? I can't find the relevant code/commits
> 
> tip tree. branch x86/apic
> 
> -Tony

Cheers!
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index ec538d3..8b4e231 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -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));
 	}
 }