From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: catalin.marinas@arm.com, will@kernel.org
Cc: baolin.wang7@gmail.com, linux-arm-kernel@lists.infradead.org,
baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org
Subject: [PATCH] arm64: PCI: Validate the node before setting node id for root bus
Date: Tue, 22 Sep 2020 18:33:24 +0800 [thread overview]
Message-ID: <1600770804-116365-1-git-send-email-baolin.wang@linux.alibaba.com> (raw)
If the BIOS disabled the NUMA configuration, but did not change the
proximity domain description in the SRAT table, so the PCI root bus
device may get a incorrect node id by acpi_get_node().
Thus better to add a numa node validation before setting numa node
for the PCI root bus, like pci_acpi_root_get_node() does for X86
architecture.
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
arch/arm64/kernel/pci.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 1006ed2..24fe2bd 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -86,9 +86,13 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
struct pci_config_window *cfg = bridge->bus->sysdata;
struct acpi_device *adev = to_acpi_device(cfg->parent);
struct device *bus_dev = &bridge->bus->dev;
+ int node = acpi_get_node(acpi_device_handle(adev));
+
+ if (node != NUMA_NO_NODE && !node_online(node))
+ node = NUMA_NO_NODE;
ACPI_COMPANION_SET(&bridge->dev, adev);
- set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev)));
+ set_dev_node(bus_dev, node);
}
return 0;
--
1.8.3.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-09-22 10:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 10:33 Baolin Wang [this message]
2020-09-28 14:00 ` [PATCH] arm64: PCI: Validate the node before setting node id for root bus Will Deacon
2020-09-28 14:49 ` Baolin Wang
2020-09-28 15:23 ` Lorenzo Pieralisi
2020-09-29 15:41 ` Baolin Wang
2020-10-01 8:55 ` Lorenzo Pieralisi
2020-10-03 9:35 ` Baolin Wang
2020-11-09 12:27 ` Baolin Wang
2020-11-12 17:05 ` Lorenzo Pieralisi
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=1600770804-116365-1-git-send-email-baolin.wang@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=baolin.wang7@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=will@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).