From: Robert Richter <robert.richter@cavium.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
Sergey Temerkhanov <s.temerkhanov@gmail.com>,
Sinan Kaya <okaya@codeaurora.org>,
Zhou Wang <wangzhou1@hisilicon.com>,
Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
Subject: Re: [RFC/RFT PATCH v2 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node() implementation
Date: Tue, 16 May 2017 17:15:29 +0200 [thread overview]
Message-ID: <20170516151529.GC658@rric.localdomain> (raw)
In-Reply-To: <20170515132205.19622-4-lorenzo.pieralisi@arm.com>
On 15.05.17 14:22:05, Lorenzo Pieralisi wrote:
> The introduction of pci_bus_find_numa_node(pci_bus) allows at PCI
> host bridge registration to detect the NUMA node for a given
> struct pci_bus.dev. Implement an ACPI method that, through
> the struct pci_bus.bridge ACPI companion, retrieve and return
> the NUMA node corresponding to a given struct pci_bus.dev.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> ---
> drivers/pci/pci-acpi.c | 20 ++++++++++++++++++++
> drivers/pci/pci.c | 2 +-
> include/linux/pci.h | 6 ++++++
> 3 files changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index e9803c1..451342d 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -5406,7 +5406,7 @@ int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent)
>
> int pci_bus_find_numa_node(struct pci_bus *bus)
> {
> - return NUMA_NO_NODE;
> + return acpi_disabled ? NUMA_NO_NODE : acpi_pci_bus_find_numa_node(bus);
I looked into how this works with devicetree.
With ACPI it is set directly in pci_register_host_bridge() with
set_dev_node().
For the DT case the set_dev_node call sets it to NUMA_NO_NODE first.
Since in DT the bridge is a platform device which has the node id
assigned already (if there is one), the bus' node id is set later in
device_add() when deriving it from the parent device which is the
bridge. So this should work.
I have tested it both DT and ACPI.
Thanks,
-Robert
> }
>
> /**
next prev parent reply other threads:[~2017-05-16 15:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 13:22 [RFC/RFT PATCH v2 0/3] PCI: generic device NUMA node detection Lorenzo Pieralisi
2017-05-15 13:22 ` [RFC/RFT PATCH v2 1/3] PCI: Introduce pci_bus_find_numa_node() Lorenzo Pieralisi
2017-05-15 13:22 ` [RFC/RFT PATCH v2 2/3] PCI: Add call to set-up NUMA node for struct pci_bus devices Lorenzo Pieralisi
2017-05-15 13:22 ` [RFC/RFT PATCH v2 3/3] PCI/ACPI: Add ACPI pci_bus_find_numa_node() implementation Lorenzo Pieralisi
2017-05-16 15:15 ` Robert Richter [this message]
2017-05-16 18:02 ` Lorenzo Pieralisi
2017-05-17 13:46 ` Lorenzo Pieralisi
2017-05-17 14:35 ` Robert Richter
2017-05-17 16:04 ` Lorenzo Pieralisi
2017-05-17 16:15 ` Robert Richter
2017-05-15 13:51 ` [RFC/RFT PATCH v2 0/3] PCI: generic device NUMA node detection Vadim Lomovtsev
2017-05-16 14:57 ` Robert Richter
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=20170516151529.GC658@rric.localdomain \
--to=robert.richter@cavium.com \
--cc=Vadim.Lomovtsev@caviumnetworks.com \
--cc=bhelgaas@google.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=okaya@codeaurora.org \
--cc=s.temerkhanov@gmail.com \
--cc=wangzhou1@hisilicon.com \
/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