From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5ECA18CC11; Tue, 10 Sep 2024 10:14:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725963271; cv=none; b=nwVDKIIi0OhejvdDDOyvW7P5u5HjtQmw16lCgcRFVrCvmLI6wOoBWuUzS8TWoWR5+0OzrbSmJD58+OMacLJVebFj/lzrne4vIoBRKEiLbWd99uEzUO3ng0r9YpT4Qeu36B0rFclRhdqlQYGoC+lsxbYY0nE5/rBi2lcbF7H7l8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725963271; c=relaxed/simple; bh=M2efppk0WhIMGlK05U9z+gRWRgeJo6Zt3tia2oDNbGc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iEdXmhpeeMmQ38c6es49hGd9MQJjyYgEHrdSZP0zYf0OMndRSjwUS/VPSSzaYt3Gx/1bnGUVO4AlANyUMluN+/SU7nk+y6cgUWZ91KSbkD2pZ7SZCtpTlQ/ECBb26fl3GXxnti5KxcdmZs/4cIy8hLMveOn4cjUK0Jpdnqi0ZXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=okeQYDm0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="okeQYDm0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5871C4CEC3; Tue, 10 Sep 2024 10:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725963271; bh=M2efppk0WhIMGlK05U9z+gRWRgeJo6Zt3tia2oDNbGc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=okeQYDm0xYLHa7qpNMuNnPUfvYAcm6Gjwr8zXjYuwYnlPLO0Rw6fLhZ+VO6FeyyGP 4UjTtueWjXemquTBS/DXTaN0waLccDMgkz2VmOgvGGumcaR+oqskFYX3sBwMqFNLIS NfZn1/SxWk5AoA9xoY9rAAWcuh5wdWAi09o6PLVE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, James Morse , Jonathan Cameron , Gavin Shan , Miguel Luis , Vishnu Pajjuri , Jianyong Wu , "Russell King (Oracle)" , Hanjun Guo , Lorenzo Pieralisi , Catalin Marinas , Sasha Levin Subject: [PATCH 6.1 167/192] arm64: acpi: Move get_cpu_for_acpi_id() to a header Date: Tue, 10 Sep 2024 11:33:11 +0200 Message-ID: <20240910092604.778919674@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092557.876094467@linuxfoundation.org> References: <20240910092557.876094467@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Morse [ 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 Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Tested-by: Miguel Luis Tested-by: Vishnu Pajjuri Tested-by: Jianyong Wu Signed-off-by: Russell King (Oracle) Acked-by: Hanjun Guo Signed-off-by: Jonathan Cameron Reviewed-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20240529133446.28446-12-Jonathan.Cameron@huawei.com Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/include/asm/acpi.h | 11 +++++++++++ arch/arm64/kernel/acpi_numa.c | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index bd68e1b7f29f..0d1da93a5bad 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -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); diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c index ccbff21ce1fa..2465f291c7e1 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) { -- 2.43.0