[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ef55959-66f3-0dc3-dec8-e2b673f965a4@redhat.com>
Date: Tue, 19 Sep 2023 11:16:40 +1000
From: Gavin Shan <gshan@...hat.com>
To: James Morse <james.morse@....com>, linux-pm@...r.kernel.org,
loongarch@...ts.linux.dev, linux-acpi@...r.kernel.org,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-riscv@...ts.infradead.org, kvmarm@...ts.linux.dev
Cc: x86@...nel.org, Salil Mehta <salil.mehta@...wei.com>,
Russell King <linux@...linux.org.uk>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
jianyong.wu@....com, justin.he@....com
Subject: Re: [RFC PATCH v2 26/35] arm64: acpi: Move get_cpu_for_acpi_id() to a
header
On 9/14/23 02:38, James Morse wrote:
> ACPI identifies CPUs by UID. get_cpu_for_acpi_id() maps the ACPI UID
> to the linux CPU number.
>
> The helper to retrieve this mapping is only available in arm64's numa
> code.
>
> Move it to live next to get_acpi_id_for_cpu().
>
> Signed-off-by: James Morse <james.morse@....com>
> ---
> arch/arm64/include/asm/acpi.h | 11 +++++++++++
> arch/arm64/kernel/acpi_numa.c | 11 -----------
> 2 files changed, 11 insertions(+), 11 deletions(-)
>
Reviewed-by: Gavin Shan <gshan@...hat.com>
> diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
> index 4d537d56eb84..ce5045038e87 100644
> --- a/arch/arm64/include/asm/acpi.h
> +++ b/arch/arm64/include/asm/acpi.h
> @@ -100,6 +100,17 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
> return acpi_cpu_get_madt_gicc(cpu)->uid;
> }
>
> +static inline int get_cpu_for_acpi_id(u32 uid)
> +{
> + int cpu;
> +
> + for (cpu = 0; cpu < nr_cpu_ids; cpu++)
> + if (uid == get_acpi_id_for_cpu(cpu))
> + return cpu;
> +
> + return -EINVAL;
> +}
> +
> static inline void arch_fix_phys_package_id(int num, u32 slot) { }
> void __init acpi_init_cpus(void);
> int apei_claim_sea(struct pt_regs *regs);
> diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
> index e51535a5f939..0c036a9a3c33 100644
> --- a/arch/arm64/kernel/acpi_numa.c
> +++ b/arch/arm64/kernel/acpi_numa.c
> @@ -34,17 +34,6 @@ int __init acpi_numa_get_nid(unsigned int cpu)
> return acpi_early_node_map[cpu];
> }
>
> -static inline int get_cpu_for_acpi_id(u32 uid)
> -{
> - int cpu;
> -
> - for (cpu = 0; cpu < nr_cpu_ids; cpu++)
> - if (uid == get_acpi_id_for_cpu(cpu))
> - return cpu;
> -
> - return -EINVAL;
> -}
> -
> static int __init acpi_parse_gicc_pxm(union acpi_subtable_headers *header,
> const unsigned long end)
> {
Powered by blists - more mailing lists