]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm64: acpi: Move get_cpu_for_acpi_id() to a header
authorJames Morse <james.morse@arm.com>
Wed, 29 May 2024 13:34:38 +0000 (14:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:06:51 +0000 (11:06 +0200)
[ Upstream commit 8d34b6f17b9ac93faa2791eb037dcb08bdf755de ]

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@arm.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Tested-by: Miguel Luis <miguel.luis@oracle.com>
Tested-by: Vishnu Pajjuri <vishnu@os.amperecomputing.com>
Tested-by: Jianyong Wu <jianyong.wu@arm.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Link: https://lore.kernel.org/r/20240529133446.28446-12-Jonathan.Cameron@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/include/asm/acpi.h
arch/arm64/kernel/acpi_numa.c

index bd68e1b7f29f34552b9e4decd2c430a6d3916c43..0d1da93a5bad424a7e6a7efba93e7ee18aaef21c 100644 (file)
@@ -97,6 +97,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);
index 048b75cadd2fd99343f1be974bb4f6de6a870b05..c5feac18c238afe0d075e64c7a26627da309e75a 100644 (file)
@@ -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)
 {