Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2168840lqa; Tue, 30 Apr 2024 09:48:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4EgYALqsyfEqLThKJfmjdXoywdoHg6l61/BCEIcdU7RA760mNJ66pF993QRxk9IEQ2zFCM2r73qfgr58ABTfkb8X3KF3nz16QQdsyOw== X-Google-Smtp-Source: AGHT+IE+iGNntfAmGsg9HDTNH61tEfGH41B3PpLh+eq6rId5H5Ix2URPljKKS59MSocaoWh6PPLf X-Received: by 2002:a05:6358:52c4:b0:186:c06f:435c with SMTP id z4-20020a05635852c400b00186c06f435cmr457372rwz.24.1714495706421; Tue, 30 Apr 2024 09:48:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714495706; cv=pass; d=google.com; s=arc-20160816; b=Tkrald1irL/+iwhqOgQCygPeCJUGeyEBMB1ufZSWnb/UhZ0IM4Ej0QKvjpRx+P+qiO +5UF1gKrxcX6gufEMXHhgFPCKh80SA9/DW24wpJO5fD7E25mEC5LtwS7kSIb/eazHZ91 zj7+49itwK1nxK08KTxR2/N/bW3xfWdOyNjBWxjcrlnrWLWaTXmMOiKWE61oA5FFJ1Jf 4BgKwsotiZwzHYQ748Vi5pxt6F5BJ8PE0BklqzVTaNMjKpIlrD2A57ImB11v1BLPK3PQ uUKT49PXFOaEcqLwEEHqg+Q9BBdd7cHfeKwlhUgYnJOLbL5TCxqHVtHYyqQL6W6K6IYm cQXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OfGtjrOBTngzNP5sotNBMPlejcVMMoawp/wNXsiGeAI=; fh=D7yEu7JeCgrGJUChA80g6fjntVs4r7MDoD5J6eGws6o=; b=kxNnZ/CuD2n66IIGN383ff5Wt1i4nCviV5gqGCCKTwYb4zfcdA7t2ZRwFy+Ro6ZIHb LHL7D3X/J998T43JWWALNO6Giche3da8aZnAAbs/CvvjKEmKnTR/bWFpTnM3Kp6xyzAF /7NIyga/8ZyoTmAErFXHcemKdokvXXR2v1L7O1qn6i7gtHx73jIEteIVx0B4UVfPyGOA GS6VYfOfU0oHEIEV8bc5XHMCYEP5xx/8bMdIh6RtPHiJMiNubIxiqZ5QaUMBhM/KDJSq XeTDcwudSMATTh3uHbDDBaenCTop/20GNQ47bQHq2MxrhtAe9MyeNK0qjKev2SdxzY8r Gohw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CdPI3j+f; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-164405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c27-20020a634e1b000000b005dc8915c9cesi22226626pgb.381.2024.04.30.09.48.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 09:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CdPI3j+f; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-164405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5B561288530 for ; Tue, 30 Apr 2024 16:39:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AE991802A5; Tue, 30 Apr 2024 16:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CdPI3j+f" 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 A2CA017BB2A; Tue, 30 Apr 2024 16:38:07 +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=1714495087; cv=none; b=JThwONKuLajeqEkc5qsvkMIqE9uT76C0v+HDooB7hjRJ4EUDjgk3PbW1X4I78eEkAXGocBpcUNWK7Y7U9iFjf1SZ9oMun2QwOGj7hXGT8FwYZyW7z+Ztdi9QwmzR41b/SDdop8h0IyTSRHCpyJDEf8u0hFObInDdYdh1gLIcY7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714495087; c=relaxed/simple; bh=Ea+j+o7qluZ3aaBqBGHNFexj3b3TayUV5vNIzNDaABo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F5dyto/fmiYabjWx+YT4RBepLZqnJfWisOxdHm+/AhKgZaeEgH0Vjy1uRbaZzPymH+XcFvpGJlA6CgKsPxOJk6WVZXPZ2LL4xEhZ/gBMazYX8z+RmTIF7lZhB8wxKja2mVHG6uvR0xb0K3M82QjBz8HXeFpPUY8jp04Khr//Rqw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CdPI3j+f; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240426135126.12802-10-Jonathan.Cameron@huawei.com> 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 >