linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: PCI: Validate the node before setting node id for root bus
@ 2020-09-22 10:33 Baolin Wang
  2020-09-28 14:00 ` Will Deacon
  0 siblings, 1 reply; 9+ messages in thread
From: Baolin Wang @ 2020-09-22 10:33 UTC (permalink / raw)
  To: catalin.marinas, will
  Cc: baolin.wang, baolin.wang7, linux-arm-kernel, linux-kernel

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


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

end of thread, other threads:[~2020-11-12 17:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 10:33 [PATCH] arm64: PCI: Validate the node before setting node id for root bus Baolin Wang
2020-09-28 14:00 ` 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

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).