Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode
@ 2017-04-06 11:47 Sergey Temerkhanov
  2017-04-07 17:18 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 7+ messages in thread
From: Sergey Temerkhanov @ 2017-04-06 11:47 UTC (permalink / raw)
  To: linux-arm-kernel

This commit modifies ARM64-specific ACPI PCI support functions to
properly set the numa_node property on host bridges and thus on PCI
devices. Such support requires _PXM objects to be set in DSDT/SSDT
tables describing PCI root bridges

Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
---
 arch/arm64/kernel/pci.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 4f0e3ebfea4b..c45c7a26f984 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -81,7 +81,16 @@ int raw_pci_write(unsigned int domain, unsigned int bus,
 
 int pcibus_to_node(struct pci_bus *bus)
 {
-	return dev_to_node(&bus->dev);
+	struct pci_config_window *cfg = bus->sysdata;
+	struct acpi_device *adev = NULL;
+	struct device *dev;
+
+	if (!acpi_disabled)
+		adev = to_acpi_device(cfg->parent);
+
+	dev = adev ? &adev->dev : &bus->dev;
+
+	return dev_to_node(dev);
 }
 EXPORT_SYMBOL(pcibus_to_node);
 
@@ -186,6 +195,8 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
 	struct pci_bus *bus, *child;
 	struct acpi_pci_root_ops *root_ops;
 
+	set_dev_node(&root->device->dev, node);
+
 	ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node);
 	if (!ri)
 		return NULL;
-- 
2.12.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread
[parent not found: <0dada57f-4215-4ced-482d-88203857e06d@codeaurora.org>]

end of thread, other threads:[~2017-04-21 17:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06 11:47 [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode Sergey Temerkhanov
2017-04-07 17:18 ` Lorenzo Pieralisi
2017-04-07 18:31   ` Sergei Temerkhanov
2017-04-21 17:17     ` Lorenzo Pieralisi
     [not found] <0dada57f-4215-4ced-482d-88203857e06d@codeaurora.org>
2017-04-12 17:04 ` Lorenzo Pieralisi
2017-04-12 17:27   ` Sinan Kaya
2017-04-12 17:48     ` Sinan Kaya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox