* [PATCH v3 0/1] ARM64/PCI: ACPI NUMA node set-up
@ 2017-05-24 17:22 Lorenzo Pieralisi
2017-05-24 17:22 ` [PATCH v3 1/1] ARM64/PCI: Set root bus NUMA node on ACPI systems Lorenzo Pieralisi
0 siblings, 1 reply; 4+ messages in thread
From: Lorenzo Pieralisi @ 2017-05-24 17:22 UTC (permalink / raw)
To: linux-arm-kernel
This patch series is v3 of a previous posting:
v2 -> v3
- Dropped generic approach
# It was not consistent between ACPI and DT and not reusable on x86/IA64
- Trimmed the series to one patch ARM64 specific, three-line patch fixes
the issue
- Rebased against v4.12-rc2
- Dropped RFC/RFT tag
v2: https://lkml.org/lkml/2017/5/15/433
v1 -> v2:
- Added missing call to acpi_pci_bus_find_numa_node()
- Rebased against v4.12-rc1
v1: https://lkml.org/lkml/2017/4/26/211
--- Original Cover Letter --
On the ARM64 architecture, the arch specific PCI pcibus_to_node() callback
can be triggered on struct pci_bus.sysdata structures that carry host
bridge specific data through different structures layout (ie sysdata
pointer points at different structs for different host bridges), therefore
it is not possible to have a unified pcibus_to_node() implementation.
Given that the device NUMA node is a property of the struct pci_bus (and
its associated struct device), move the struct pci_bus node assignment to
generic PCI code, where according to the platform firmware the NUMA node
for the device backing the struct pci_bus is retrieved and propagated
through the PCI bus hierarchy.
Lorenzo Pieralisi (1):
ARM64/PCI: Set root bus NUMA node on ACPI systems
arch/arm64/kernel/pci.c | 3 +++
1 file changed, 3 insertions(+)
--
2.10.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/1] ARM64/PCI: Set root bus NUMA node on ACPI systems
2017-05-24 17:22 [PATCH v3 0/1] ARM64/PCI: ACPI NUMA node set-up Lorenzo Pieralisi
@ 2017-05-24 17:22 ` Lorenzo Pieralisi
2017-05-29 8:32 ` Robert Richter
2017-05-30 10:47 ` Will Deacon
0 siblings, 2 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2017-05-24 17:22 UTC (permalink / raw)
To: linux-arm-kernel
PCI core requires the NUMA node for the struct pci_host_bridge.dev to
be set by using the pcibus_to_node(struct pci_bus*) API, that on ARM64
systems relies on the struct pci_host_bridge->bus.dev NUMA node.
The struct pci_host_bridge.dev NUMA node is then propagated through
the PCI device hierarchy as PCI devices (and bridges) are enumerated
under it.
Therefore, in order to set-up the PCI NUMA hierarchy appropriately, the
struct pci_host_bridge->bus.dev NUMA node must be set before core
code calls pcibus_to_node(struct pci_bus*) on it so that PCI core can
retrieve the NUMA node for the struct pci_host_bridge.dev device and can
propagate it through the PCI bus tree.
On ARM64 ACPI based systems the struct pci_host_bridge->bus.dev NUMA
node can be set-up in pcibios_root_bridge_prepare() by parsing the root
bridge ACPI device firmware binding.
Add code to the pcibios_root_bridge_prepare() that, when booting with
ACPI, parse the root bridge ACPI device companion NUMA binding and set
the corresponding struct pci_host_bridge->bus.dev NUMA node
appropriately.
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm64/kernel/pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 4f0e3eb..1082834 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -108,7 +108,10 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
if (!acpi_disabled) {
struct pci_config_window *cfg = bridge->bus->sysdata;
struct acpi_device *adev = to_acpi_device(cfg->parent);
+ struct device *bus_dev = &bridge->bus->dev;
+
ACPI_COMPANION_SET(&bridge->dev, adev);
+ set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev)));
}
return 0;
--
2.10.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 1/1] ARM64/PCI: Set root bus NUMA node on ACPI systems
2017-05-24 17:22 ` [PATCH v3 1/1] ARM64/PCI: Set root bus NUMA node on ACPI systems Lorenzo Pieralisi
@ 2017-05-29 8:32 ` Robert Richter
2017-05-30 10:47 ` Will Deacon
1 sibling, 0 replies; 4+ messages in thread
From: Robert Richter @ 2017-05-29 8:32 UTC (permalink / raw)
To: linux-arm-kernel
On 24.05.17 18:22:19, Lorenzo Pieralisi wrote:
> PCI core requires the NUMA node for the struct pci_host_bridge.dev to
> be set by using the pcibus_to_node(struct pci_bus*) API, that on ARM64
> systems relies on the struct pci_host_bridge->bus.dev NUMA node.
>
> The struct pci_host_bridge.dev NUMA node is then propagated through
> the PCI device hierarchy as PCI devices (and bridges) are enumerated
> under it.
>
> Therefore, in order to set-up the PCI NUMA hierarchy appropriately, the
> struct pci_host_bridge->bus.dev NUMA node must be set before core
> code calls pcibus_to_node(struct pci_bus*) on it so that PCI core can
> retrieve the NUMA node for the struct pci_host_bridge.dev device and can
> propagate it through the PCI bus tree.
>
> On ARM64 ACPI based systems the struct pci_host_bridge->bus.dev NUMA
> node can be set-up in pcibios_root_bridge_prepare() by parsing the root
> bridge ACPI device firmware binding.
>
> Add code to the pcibios_root_bridge_prepare() that, when booting with
> ACPI, parse the root bridge ACPI device companion NUMA binding and set
> the corresponding struct pci_host_bridge->bus.dev NUMA node
> appropriately.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
Looks good.
Reviewed-by: Robert Richter <rrichter@cavium.com>
Tested-by: Robert Richter <rrichter@cavium.com>
Thanks,
-Robert
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/1] ARM64/PCI: Set root bus NUMA node on ACPI systems
2017-05-24 17:22 ` [PATCH v3 1/1] ARM64/PCI: Set root bus NUMA node on ACPI systems Lorenzo Pieralisi
2017-05-29 8:32 ` Robert Richter
@ 2017-05-30 10:47 ` Will Deacon
1 sibling, 0 replies; 4+ messages in thread
From: Will Deacon @ 2017-05-30 10:47 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, May 24, 2017 at 06:22:19PM +0100, Lorenzo Pieralisi wrote:
> PCI core requires the NUMA node for the struct pci_host_bridge.dev to
> be set by using the pcibus_to_node(struct pci_bus*) API, that on ARM64
> systems relies on the struct pci_host_bridge->bus.dev NUMA node.
>
> The struct pci_host_bridge.dev NUMA node is then propagated through
> the PCI device hierarchy as PCI devices (and bridges) are enumerated
> under it.
>
> Therefore, in order to set-up the PCI NUMA hierarchy appropriately, the
> struct pci_host_bridge->bus.dev NUMA node must be set before core
> code calls pcibus_to_node(struct pci_bus*) on it so that PCI core can
> retrieve the NUMA node for the struct pci_host_bridge.dev device and can
> propagate it through the PCI bus tree.
>
> On ARM64 ACPI based systems the struct pci_host_bridge->bus.dev NUMA
> node can be set-up in pcibios_root_bridge_prepare() by parsing the root
> bridge ACPI device firmware binding.
>
> Add code to the pcibios_root_bridge_prepare() that, when booting with
> ACPI, parse the root bridge ACPI device companion NUMA binding and set
> the corresponding struct pci_host_bridge->bus.dev NUMA node
> appropriately.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> ---
> arch/arm64/kernel/pci.c | 3 +++
> 1 file changed, 3 insertions(+)
Thanks, I'll queue this with Robert's tags.
Will
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-30 10:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24 17:22 [PATCH v3 0/1] ARM64/PCI: ACPI NUMA node set-up Lorenzo Pieralisi
2017-05-24 17:22 ` [PATCH v3 1/1] ARM64/PCI: Set root bus NUMA node on ACPI systems Lorenzo Pieralisi
2017-05-29 8:32 ` Robert Richter
2017-05-30 10:47 ` Will Deacon
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).