linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device
@ 2016-09-10 15:40 Rui Wang
  2016-09-10 17:27 ` Borislav Petkov
  2016-09-12 21:25 ` Jon Derrick
  0 siblings, 2 replies; 5+ messages in thread
From: Rui Wang @ 2016-09-10 15:40 UTC (permalink / raw)
  To: bhelgaas, tglx, rjw, mingo, bp
  Cc: torvalds, peterz, helgaas, linux-acpi, linux-pci, tony.luck, x86,
	linux-kernel, rui.y.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

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));
 	}
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device
  2016-09-10 15:40 [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device Rui Wang
@ 2016-09-10 17:27 ` Borislav Petkov
  2016-09-12 21:25 ` Jon Derrick
  1 sibling, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2016-09-10 17:27 UTC (permalink / raw)
  To: Rui Wang
  Cc: bhelgaas, tglx, rjw, mingo, torvalds, peterz, helgaas, linux-acpi,
	linux-pci, tony.luck, x86, linux-kernel

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!

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device
  2016-09-10 15:40 [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device Rui Wang
  2016-09-10 17:27 ` Borislav Petkov
@ 2016-09-12 21:25 ` Jon Derrick
  2016-09-12 21:43   ` Luck, Tony
  1 sibling, 1 reply; 5+ messages in thread
From: Jon Derrick @ 2016-09-12 21:25 UTC (permalink / raw)
  To: Rui Wang
  Cc: bhelgaas, tglx, rjw, mingo, bp, torvalds, peterz, helgaas,
	linux-acpi, linux-pci, tony.luck, x86, linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device
  2016-09-12 21:25 ` Jon Derrick
@ 2016-09-12 21:43   ` Luck, Tony
  2016-09-12 21:46     ` Jon Derrick
  0 siblings, 1 reply; 5+ messages in thread
From: Luck, Tony @ 2016-09-12 21:43 UTC (permalink / raw)
  To: Derrick, Jonathan, Wang, Rui Y
  Cc: bhelgaas@google.com, tglx@linutronix.de, rjw@rjwysocki.net,
	mingo@kernel.org, bp@alien8.de, torvalds@linux-foundation.org,
	peterz@infradead.org, helgaas@kernel.org,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
	x86@kernel.org, linux-kernel@vger.kernel.org

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

tip tree. branch x86/apic

-Tony

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device
  2016-09-12 21:43   ` Luck, Tony
@ 2016-09-12 21:46     ` Jon Derrick
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Derrick @ 2016-09-12 21:46 UTC (permalink / raw)
  To: Luck, Tony
  Cc: Wang, Rui Y, bhelgaas@google.com, tglx@linutronix.de,
	rjw@rjwysocki.net, mingo@kernel.org, bp@alien8.de,
	torvalds@linux-foundation.org, peterz@infradead.org,
	helgaas@kernel.org, linux-acpi@vger.kernel.org,
	linux-pci@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org

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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-12 21:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-10 15:40 [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device Rui Wang
2016-09-10 17:27 ` Borislav Petkov
2016-09-12 21:25 ` Jon Derrick
2016-09-12 21:43   ` Luck, Tony
2016-09-12 21:46     ` Jon Derrick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).