All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode
@ 2017-04-08 17:17 Sinan Kaya
  2017-04-12 17:04   ` Lorenzo Pieralisi
  0 siblings, 1 reply; 15+ messages in thread
From: Sinan Kaya @ 2017-04-08 17:17 UTC (permalink / raw)
  To: linux-acpi, linux-arm-kernel

On 12/31/1969 7:00 PM, linux-arm-kernel [mailto:linux-arm-kernel-bounces@lists.infradead.org] On Behalf Of Sergey Temerkhanov wrote:
>  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);
> +

I see a problem here that NUMA node information is read from the parent device.
PCI bus can have multiple levels of switches and bridges. The NUMA information
is only present on the host bridge.

This code only works if the endpoint is directly connected to the root port. 

You should follow a similar design pattern like pci_dma_configure() where
you go to the host bridge device from any pci device and read the _PXM from
the host bridge.

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode
@ 2017-04-06 11:47 ` Sergey Temerkhanov
  0 siblings, 0 replies; 15+ messages in thread
From: Sergey Temerkhanov @ 2017-04-06 11:47 UTC (permalink / raw)
  To: linux-acpi, 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] 15+ messages in thread

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

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-08 17:17 [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode Sinan Kaya
2017-04-12 17:04 ` Lorenzo Pieralisi
2017-04-12 17:04   ` Lorenzo Pieralisi
2017-04-12 17:27   ` Sinan Kaya
2017-04-12 17:27     ` Sinan Kaya
2017-04-12 17:48     ` Sinan Kaya
2017-04-12 17:48       ` Sinan Kaya
  -- strict thread matches above, loose matches on Subject: below --
2017-04-06 11:47 Sergey Temerkhanov
2017-04-06 11:47 ` Sergey Temerkhanov
2017-04-07 17:18 ` Lorenzo Pieralisi
2017-04-07 17:18   ` Lorenzo Pieralisi
2017-04-07 18:31   ` Sergei Temerkhanov
2017-04-07 18:31     ` Sergei Temerkhanov
2017-04-21 17:17     ` Lorenzo Pieralisi
2017-04-21 17:17       ` Lorenzo Pieralisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.