linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Atish Patra <atish.patra@wdc.com>
Cc: <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Zong Li <zong.li@sifive.com>, <linux-riscv@lists.infradead.org>,
	Will Deacon <will@kernel.org>, <linux-arch@vger.kernel.org>,
	Rob Herring <robh@kernel.org>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	Ganapatrao Kulkarni <gkulkarni@cavium.com>,
	Steven Price <steven.price@arm.com>,
	Greentime Hu <greentime.hu@sifive.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Arnd Bergmann <arnd@arndb.de>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	<linux-arm-kernel@lists.infradead.org>,
	Nick Hu <nickhu@andestech.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Anup Patel <Anup.Patel@wdc.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Rapoport <rppt@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>, <linux-pci@vger.kernel.org>
Subject: Re: [RFC/RFT PATCH 3/6] arm64, numa: Move pcibus_to_node definition to generic numa code
Date: Fri, 28 Aug 2020 10:48:30 +0100	[thread overview]
Message-ID: <20200828104830.000007bf@Huawei.com> (raw)
In-Reply-To: <20200814214725.28818-4-atish.patra@wdc.com>

On Fri, 14 Aug 2020 14:47:22 -0700
Atish Patra <atish.patra@wdc.com> wrote:

> pcibus_to_node is used only when numa is enabled and does not depend
> on ISA. Thus, it can be moved the generic numa implementation.
> 
> Signed-off-by: Atish Patra <atish.patra@wdc.com>

From a more general unification point of view, there seem to
be two ways architectures implement this.
Either

bus->sysdata.node

Or as here.
There are weird other options, but let us ignore those :)

That is going to take a bit of unwinding should we
want to take this unification further and perhaps we want to think
about doing this in pci generic code rather than here?

Perhaps this is one we are better keeping architecture specific for
now?

+CC Bjorn and Linux-pci


> ---
>  arch/arm64/kernel/pci.c  | 10 ----------
>  drivers/base/arch_numa.c | 11 +++++++++++
>  2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> index 1006ed2d7c60..07c122946c11 100644
> --- a/arch/arm64/kernel/pci.c
> +++ b/arch/arm64/kernel/pci.c
> @@ -54,16 +54,6 @@ int raw_pci_write(unsigned int domain, unsigned int bus,
>  	return b->ops->write(b, devfn, reg, len, val);
>  }
>  
> -#ifdef CONFIG_NUMA
> -
> -int pcibus_to_node(struct pci_bus *bus)
> -{
> -	return dev_to_node(&bus->dev);
> -}
> -EXPORT_SYMBOL(pcibus_to_node);
> -
> -#endif
> -
>  #ifdef CONFIG_ACPI
>  
>  struct acpi_pci_generic_root_info {
> diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c
> index 83341c807240..4ab1b20a615d 100644
> --- a/drivers/base/arch_numa.c
> +++ b/drivers/base/arch_numa.c
> @@ -11,6 +11,7 @@
>  #include <linux/acpi.h>
>  #include <linux/memblock.h>
>  #include <linux/module.h>
> +#include <linux/pci.h>
>  #include <linux/of.h>
>  
>  #ifdef CONFIG_ARM64
> @@ -60,6 +61,16 @@ EXPORT_SYMBOL(cpumask_of_node);
>  
>  #endif
>  
> +#ifdef CONFIG_PCI
> +
> +int pcibus_to_node(struct pci_bus *bus)
> +{
> +	return dev_to_node(&bus->dev);
> +}
> +EXPORT_SYMBOL(pcibus_to_node);
> +
> +#endif
> +
>  static void numa_update_cpu(unsigned int cpu, bool remove)
>  {
>  	int nid = cpu_to_node(cpu);



  reply	other threads:[~2020-08-28  9:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 21:47 [RFC/RFT PATCH 0/6] Unify NUMA implementation between ARM64 & RISC-V Atish Patra
2020-08-14 21:47 ` [RFC/RFT PATCH 1/6] numa: Move numa implementation to common code Atish Patra
2020-08-14 23:19   ` Randy Dunlap
2020-08-19  3:18   ` Anshuman Khandual
2020-08-19 19:18     ` Atish Patra
2020-08-20  3:20       ` Anshuman Khandual
2020-08-21 21:58         ` Atish Patra
2020-08-28  9:13           ` Jonathan Cameron
2020-08-28  9:22   ` Jonathan Cameron
2020-08-29  0:31     ` Atish Patra
2020-08-14 21:47 ` [RFC/RFT PATCH 2/6] arm64, numa: Change the numa init function name to be generic Atish Patra
2020-08-28  9:35   ` Jonathan Cameron
2020-08-29  0:39     ` Atish Patra
2020-08-14 21:47 ` [RFC/RFT PATCH 3/6] arm64, numa: Move pcibus_to_node definition to generic numa code Atish Patra
2020-08-28  9:48   ` Jonathan Cameron [this message]
2020-08-28 16:15     ` Bjorn Helgaas
2020-08-29  1:11       ` Atish Patra
2020-08-30  2:54         ` Bjorn Helgaas
2020-08-30  7:22           ` Atish Patra
2020-08-14 21:47 ` [RFC/RFT PATCH 4/6] riscv: Separate memory init from paging init Atish Patra
2020-08-14 21:47 ` [RFC/RFT PATCH 5/6] riscv: Add support pte_protnone and pmd_protnone if CONFIG_NUMA_BALANCING Atish Patra
2020-08-14 21:47 ` [RFC/RFT PATCH 6/6] riscv: Add numa support for riscv64 platform Atish Patra
2020-08-14 23:21   ` Randy Dunlap

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=20200828104830.000007bf@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Anup.Patel@wdc.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=atish.patra@wdc.com \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=gkulkarni@cavium.com \
    --cc=greentime.hu@sifive.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nickhu@andestech.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=rppt@kernel.org \
    --cc=steven.price@arm.com \
    --cc=will@kernel.org \
    --cc=zong.li@sifive.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;
as well as URLs for NNTP newsgroup(s).