public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: Sudeep Holla <sudeep.holla@arm.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>
Cc: Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	<linux-acpi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Hanjun Guo <guohanjun@huawei.com>
Subject: [PATCH 3/3] ARM64: ACPI: Move the NUMA code to drivers/acpi/arm64/
Date: Thu, 8 Aug 2024 21:15:22 +0800	[thread overview]
Message-ID: <20240808131522.1032431-4-guohanjun@huawei.com> (raw)
In-Reply-To: <20240808131522.1032431-1-guohanjun@huawei.com>

The ARM64 ACPI NUMA code can be moved out of arm64 arch code
as it just related to ACPI NUMA table parsing, mappings for
ACPI NUMA and cpu, move the ACPI NUMA code to drivers/acpi/arm64/.

Since arm64 selects ACPI_NUMA by default, so just move the function
definitions under CONFIG_ARM64 in linux/acpi.h.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 arch/arm64/include/asm/acpi.h                         | 8 --------
 arch/arm64/kernel/Makefile                            | 1 -
 drivers/acpi/arm64/Makefile                           | 1 +
 {arch/arm64/kernel => drivers/acpi/arm64}/acpi_numa.c | 0
 include/linux/acpi.h                                  | 4 ++++
 5 files changed, 5 insertions(+), 9 deletions(-)
 rename {arch/arm64/kernel => drivers/acpi/arm64}/acpi_numa.c (100%)

diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index 5e25110ad1b7..572355783971 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -174,14 +174,6 @@ static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
 }
 #endif /* CONFIG_ACPI_APEI */
 
-#ifdef CONFIG_ACPI_NUMA
-int acpi_numa_get_nid(unsigned int cpu);
-void acpi_map_cpus_to_nodes(void);
-#else
-static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; }
-static inline void acpi_map_cpus_to_nodes(void) { }
-#endif /* CONFIG_ACPI_NUMA */
-
 #define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE
 
 #endif /*_ASM_ACPI_H*/
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 2b112f3b7510..c7d09c6348a4 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -52,7 +52,6 @@ obj-$(CONFIG_EFI)			+= efi.o efi-rt-wrapper.o
 obj-$(CONFIG_PCI)			+= pci.o
 obj-$(CONFIG_ARMV8_DEPRECATED)		+= armv8_deprecated.o
 obj-$(CONFIG_ACPI)			+= acpi.o
-obj-$(CONFIG_ACPI_NUMA)			+= acpi_numa.o
 obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL)	+= acpi_parking_protocol.o
 obj-$(CONFIG_PARAVIRT)			+= paravirt.o
 obj-$(CONFIG_RANDOMIZE_BASE)		+= kaslr.o
diff --git a/drivers/acpi/arm64/Makefile b/drivers/acpi/arm64/Makefile
index 05ecde9eaabe..9aeed2e4ebde 100644
--- a/drivers/acpi/arm64/Makefile
+++ b/drivers/acpi/arm64/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_ACPI_APMT) 	+= apmt.o
 obj-$(CONFIG_ACPI_FFH)		+= ffh.o
 obj-$(CONFIG_ACPI_GTDT) 	+= gtdt.o
 obj-$(CONFIG_ACPI_IORT) 	+= iort.o
+obj-$(CONFIG_ACPI_NUMA)		+= acpi_numa.o
 obj-$(CONFIG_ACPI_PROCESSOR_IDLE) += cpuidle.o
 obj-$(CONFIG_ARM_AMBA)		+= amba.o
 obj-y				+= dma.o init.o
diff --git a/arch/arm64/kernel/acpi_numa.c b/drivers/acpi/arm64/acpi_numa.c
similarity index 100%
rename from arch/arm64/kernel/acpi_numa.c
rename to drivers/acpi/arm64/acpi_numa.c
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 0687a442fec7..7de4e9dac0c7 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -253,8 +253,12 @@ static inline void acpi_arch_dma_setup(struct device *dev) { }
 #endif
 
 #ifdef CONFIG_ARM64
+int acpi_numa_get_nid(unsigned int cpu);
+void acpi_map_cpus_to_nodes(void);
 void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa);
 #else
+static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; }
+static inline void acpi_map_cpus_to_nodes(void) { }
 static inline void
 acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { }
 #endif
-- 
2.25.1


  parent reply	other threads:[~2024-08-08 13:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 13:15 [PATCH 0/3] cleanups for ARM64 ACPI Hanjun Guo
2024-08-08 13:15 ` [PATCH 1/3] ARM64: ACPI: Remove the leftover acpi_init_cpus() Hanjun Guo
2024-08-08 13:15 ` [PATCH 2/3] ARM64: ACPI: Remove the leftover arm64_acpi_numa_init() Hanjun Guo
2024-08-08 13:15 ` Hanjun Guo [this message]
2024-08-08 23:49   ` [PATCH 3/3] ARM64: ACPI: Move the NUMA code to drivers/acpi/arm64/ kernel test robot
2024-08-09  7:21   ` Sudeep Holla
2024-08-09 10:45     ` Hanjun Guo

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=20240808131522.1032431-4-guohanjun@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lpieralisi@kernel.org \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=will@kernel.org \
    /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