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 v2 3/4] ARM64: ACPI: Make acpi_numa_get_nid() invisible to kernel/smp.c
Date: Sun, 11 Aug 2024 12:23:02 +0800 [thread overview]
Message-ID: <20240811042303.3498761-4-guohanjun@huawei.com> (raw)
In-Reply-To: <20240811042303.3498761-1-guohanjun@huawei.com>
To do the preparation of moving acpi_numa.c to drivers/acpi/arm64,
Make acpi_numa_get_nid() invisible to kernel/smp.c, with less
export functions.
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
arch/arm64/include/asm/acpi.h | 2 --
arch/arm64/kernel/acpi_numa.c | 8 +++++++-
arch/arm64/kernel/smp.c | 5 -----
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index 5e25110ad1b7..40a501e1f26b 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -175,10 +175,8 @@ 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 */
diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
index 0c036a9a3c33..2e55ff02bf07 100644
--- a/arch/arm64/kernel/acpi_numa.c
+++ b/arch/arm64/kernel/acpi_numa.c
@@ -29,7 +29,7 @@
static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
-int __init acpi_numa_get_nid(unsigned int cpu)
+static int __init acpi_numa_get_nid(unsigned int cpu)
{
return acpi_early_node_map[cpu];
}
@@ -72,9 +72,15 @@ static int __init acpi_parse_gicc_pxm(union acpi_subtable_headers *header,
void __init acpi_map_cpus_to_nodes(void)
{
+ int i;
+
acpi_table_parse_entries(ACPI_SIG_SRAT, sizeof(struct acpi_table_srat),
ACPI_SRAT_TYPE_GICC_AFFINITY,
acpi_parse_gicc_pxm, 0);
+
+ for (i = 0; i < nr_cpu_ids; i++)
+ early_map_cpu_to_node(i, acpi_numa_get_nid(i));
+
}
/* Callback for Proximity Domain -> ACPI processor UID mapping */
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 5e18fbcee9a2..b717b77ed4d6 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -650,8 +650,6 @@ acpi_parse_gic_cpu_interface(union acpi_subtable_headers *header,
static void __init acpi_parse_and_init_cpus(void)
{
- int i;
-
/*
* do a walk of MADT to determine how many CPUs
* we have including disabled CPUs, and get information
@@ -669,9 +667,6 @@ static void __init acpi_parse_and_init_cpus(void)
* as separate steps.
*/
acpi_map_cpus_to_nodes();
-
- for (i = 0; i < nr_cpu_ids; i++)
- early_map_cpu_to_node(i, acpi_numa_get_nid(i));
}
#else
#define acpi_parse_and_init_cpus(...) do { } while (0)
--
2.25.1
next prev parent reply other threads:[~2024-08-11 4:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-11 4:22 [PATCH v2 0/4] Cleanups for ARM64 ACPI Hanjun Guo
2024-08-11 4:23 ` [PATCH v2 1/4] ARM64: ACPI: Remove the leftover acpi_init_cpus() Hanjun Guo
2024-08-11 4:23 ` [PATCH v2 2/4] ARM64: ACPI: Remove the leftover arm64_acpi_numa_init() Hanjun Guo
2024-08-11 4:23 ` Hanjun Guo [this message]
2024-08-11 4:23 ` [PATCH v2 4/4] ARM64: ACPI: Move the NUMA code to drivers/acpi/arm64/ Hanjun Guo
2024-08-12 3:02 ` kernel test robot
2024-08-12 3:46 ` 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=20240811042303.3498761-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