From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode
Date: Fri, 7 Apr 2017 18:18:12 +0100 [thread overview]
Message-ID: <20170407171812.GA12012@red-moon> (raw)
In-Reply-To: <20170406114711.17261-1-s.temerkhanov@gmail.com>
Hi Sergey,
On Thu, Apr 06, 2017 at 11:47:11AM +0000, Sergey Temerkhanov wrote:
> 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;
Well, this implicit cast is a guess (ie it might be a DT sysdata
and there you can't have a clue on what it really is).
> + 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);
Ok I suspect this is one of those catch-22 issues with host bridge
creation/scan code (like domain nr), let me have a look I will send
you a patch next week when I figure out the call ordering required
to make this work, I want to make sure we can make this work with
DT and ACPI alike.
Thanks !
Lorenzo
> +
> ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node);
> if (!ri)
> return NULL;
> --
> 2.12.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode
Date: Fri, 7 Apr 2017 18:18:12 +0100 [thread overview]
Message-ID: <20170407171812.GA12012@red-moon> (raw)
In-Reply-To: <20170406114711.17261-1-s.temerkhanov@gmail.com>
Hi Sergey,
On Thu, Apr 06, 2017 at 11:47:11AM +0000, Sergey Temerkhanov wrote:
> 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;
Well, this implicit cast is a guess (ie it might be a DT sysdata
and there you can't have a clue on what it really is).
> + 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);
Ok I suspect this is one of those catch-22 issues with host bridge
creation/scan code (like domain nr), let me have a look I will send
you a patch next week when I figure out the call ordering required
to make this work, I want to make sure we can make this work with
DT and ACPI alike.
Thanks !
Lorenzo
> +
> ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node);
> if (!ri)
> return NULL;
> --
> 2.12.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-04-07 17:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 11:47 [PATCH] arm64: acpi: Support PCI devices numa_node property in ACPI mode Sergey Temerkhanov
2017-04-06 11:47 ` Sergey Temerkhanov
2017-04-07 17:18 ` Lorenzo Pieralisi [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2017-04-08 17:17 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
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=20170407171812.GA12012@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=s.temerkhanov@gmail.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 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.