From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0ED70C4345F for ; Tue, 30 Apr 2024 16:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aVymQ8rczNvrhpH05Xp2Emn+M00Et1tWlm1eMiA7iek=; b=sVqucDh+GfyUB2 DlVipDaxUAknRHfztY4qBZCpy5U/NAd73NbdbV59LW/YJBdOm/ez62BGfVU32/DzCnAdgd8ImtozJ 4+zh/f0rPvavkuruUSK+4bmiQHKk5XFK+5/j7xNtUnBImL1djo02IEnSm0X4edI+jLpK+06VgQQC2 /P34y1aWtxf8r0amEHdARjDMrQSItLNV00RRtj4TdmdbjABTne3KD3fsdTuoVDerDqppLKI9smzLU mBGkzyWkN2ZC9G7o3XBRpoJPm34X56eY/aWs8RqaGq8P5zDamiA9S+I7YH54KnAiLvRSVgMO7p4rG i6zu5vbATBjK/sgGsHSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1qUd-00000007GeV-3IhS; Tue, 30 Apr 2024 16:38:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1qUb-00000007GdG-0OPm for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 16:38:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D26566165F; Tue, 30 Apr 2024 16:38:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12EA2C2BBFC; Tue, 30 Apr 2024 16:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714495087; bh=Ea+j+o7qluZ3aaBqBGHNFexj3b3TayUV5vNIzNDaABo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CdPI3j+fJEvjdlmQPVgXo3qL61z93kiPiPU0GNMO6P3czlrBXGHu0O7CqbtW1hc9l b0kfasC3XiEb1jdrIHpCbYfctwchFwn04bFT9tTFyydOPjsIVO64QoyuerTG/mtHWc f1MQmuDA1ZgE+6qtsvMJvNOYzV2vgey+Mt0Bz1ANY8ZEQSC3vcnMjGKrhPBQyybJ80 FzN/GqlqNxKYAWaqTu4sGINBQ2HfbuDQG6Vu4Zn7vzfSJ7bCmjQ0yv3q+PVjVvvP6c GEEkw7yk9uFtjwpX9eM+pdS1suoz4V6eKZK+spUuRAZnIrIhqniB6yD8zKvuuR9/bp apKC0UzuqlvYQ== Date: Tue, 30 Apr 2024 18:37:58 +0200 From: Lorenzo Pieralisi To: Jonathan Cameron Cc: Thomas Gleixner , Peter Zijlstra , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , Marc Zyngier , Hanjun Guo , Ingo Molnar , Borislav Petkov , Dave Hansen , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com, Sudeep Holla Subject: Re: [PATCH v8 09/16] arm64: acpi: Move get_cpu_for_acpi_id() to a header Message-ID: References: <20240426135126.12802-1-Jonathan.Cameron@huawei.com> <20240426135126.12802-10-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240426135126.12802-10-Jonathan.Cameron@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_093809_326211_D3F1D7D4 X-CRM114-Status: GOOD ( 24.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 26, 2024 at 02:51:19PM +0100, Jonathan Cameron wrote: > From: James Morse > > 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 > > --- > v8: Picked up tags. > --- > 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 6792a1f83f2a..bc9a6656fc0c 100644 > --- a/arch/arm64/include/asm/acpi.h > +++ b/arch/arm64/include/asm/acpi.h > @@ -119,6 +119,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; > -} > - Apologies for the late reply. If anything, it may make sense to squash this patch into the commit that is actually needing it, lest we might end up with a change that is useless if it is taken stand alone. That's all there is to say so: Reviewed-by: Lorenzo Pieralisi > static int __init acpi_parse_gicc_pxm(union acpi_subtable_headers *header, > const unsigned long end) > { > -- > 2.39.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel