linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rui Wang <rui.y.wang@intel.com>
To: bp@alien8.de
Cc: bhelgaas@google.com, torvalds@linux-foundation.org,
	peterz@infradead.org, tglx@linutronix.de, helgaas@kernel.org,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
	rjw@rjwysocki.net, tony.luck@intel.com, mingo@kernel.org,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	rui.y.wang@intel.com
Subject: Re: 584c5c422f6c ("x86/ioapic: Support hot-removal of IOAPICs present during boot")
Date: Sat, 10 Sep 2016 23:03:29 +0800	[thread overview]
Message-ID: <1473519809-31107-1-git-send-email-rui.y.wang@intel.com> (raw)
In-Reply-To: <20160910143031.5s4psayo4wqrmpt2@pd.tnic>

On Sat, Sep 10, 2016 10:31 PM, Borislav Petkov wrote:
> 
> On Sat, Sep 10, 2016 at 09:11:30PM +0800, Rui Wang wrote:
> > Thanks for the analysis. Looks like acpi_gbl_root_node == 0. It is
> 
> Is ACPI_HANDLE(root_bus->bridge) == ACPI_ROOT_OBJECT?
> 
> Because this is what the code does but I can't see it from the code that the
> handle is of type ACPI_ROOT_OBJECT...
> 

I seem to have the clue. It is because ACPI_HANDLE(root_bus->bridge) == NULL.
Then this root bridge doesn't have a corresponding ACPI device. In this case
we shouldn't call acpi_ioapic_add(). This can be true for some old platforms.

If that's the case then the patch below can fix it.

Thanks
Rui

>From b37d806c78e5eea70dbb890c1e3dbb8b7e5038e6 Mon Sep 17 00:00:00 2001
From: Rui Wang <rui.y.wang@intel.com>
Date: Sat, 10 Sep 2016 10:56:34 -0400
Subject: [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device

Some PCI root bridges don't have a corresponding ACPI device.
Don't call acpi_ioapic_add() on these bridges because they can't
support ioapic hotplug.

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
---
 drivers/pci/setup-bus.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index ec538d3..2b05ac6 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1852,10 +1852,15 @@ dump:
 void __init pci_assign_unassigned_resources(void)
 {
 	struct pci_bus *root_bus;
+	acpi_handle root_handle;
 
 	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));
+		root_handle = ACPI_HANDLE(root_bus->bridge);
+
+		/* make sure the root bridge has a companion ACPI device */
+		if (root_handle)
+			acpi_ioapic_add(root_handle);
 	}
 }
 
-- 
1.8.3.1


  reply	other threads:[~2016-09-10 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09 22:07 584c5c422f6c ("x86/ioapic: Support hot-removal of IOAPICs present during boot") Borislav Petkov
2016-09-10  0:14 ` Rui Wang
2016-09-10 11:27   ` Borislav Petkov
2016-09-10 13:11     ` Rui Wang
2016-09-10 14:30       ` Borislav Petkov
2016-09-10 15:03         ` Rui Wang [this message]
2016-09-10 15:23           ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473519809-31107-1-git-send-email-rui.y.wang@intel.com \
    --to=rui.y.wang@intel.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=helgaas@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).