Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3958538rdb; Thu, 14 Sep 2023 07:50:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFdmEWfQMBVbER/4vPJhC45T70TMJnOyoYC+/iM9MyaePXzQN0vHTNOA+5qe9wDhpANunX X-Received: by 2002:a17:902:8693:b0:1c3:188c:a347 with SMTP id g19-20020a170902869300b001c3188ca347mr5448065plo.54.1694703012387; Thu, 14 Sep 2023 07:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694703012; cv=none; d=google.com; s=arc-20160816; b=b8TYNfR+bqvzNDzXVvpgIzaJPQL582GvIoMzFtJRZ1idAqyU4Lj2z19n/jErPp/ONz 95RpGFm4bb7Ej1FwAt+RayIORSanCa//fOhqaUanlxGsomrdZMbbDZZ6VmXaV475GRoR cwWkBSVfxPkEJ1Zc9Fod5vFiIYxL5eIeFM9AZhrl/QFhJ3cYquvNjtsQ6cD3WfVQroju vs97U+zSChteo6EzrbtGrci3yy24LHfZ+PN5nmLsLTqL8tGxm40F1D5B+B8OG0jUFJgP 6bGzDa1nFykKBZNG33vNa++wYJlJsUbdQk/RK9D130K5LYDKnwFjOFATnE/A18buYt98 /0pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=paCRZj4K1qpSXtOV3cCPOeGXLpmx7amETVwLkxSgAFg=; fh=oO43h3w0Gnh1/uzgjBLTRg+oe1Gv6aFHPIod5z8aS5s=; b=p06G686q9uLxVFRdWTgNs3HAtqokhg+Pbgv4MTsCOnavg1+mkE2FTWDDvPWIpR3sqw 47M6tUkCBYPOkxJjJDfmDIGMhstF6qZA4Ys/0uqspJ9/wCQk09t1jABGShudzAnJbxEr 8nT3Ad6gUJds6pzatoAiOz4t7+o6hksdvj4fWY+Wle9gaHHbp6paytV5CpL9gUeFolIB xk00WsQat3s+ylO2NM/61rm1i/T8IVefWIX7TI01qtrJItObWzzuNYAHhfbJ7KcN2LOU gMltxQ2LxGltSVWuVeRIA7yZ7m/tTmfM81g8ZRRGo+8vJzJCLK6akB54fTUiscaPRnbZ 0IJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k6-20020a170902c40600b001c3fa9a1e3esi2041779plk.493.2023.09.14.07.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 07:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 229A582CD616; Thu, 14 Sep 2023 07:43:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234000AbjINOnM (ORCPT + 99 others); Thu, 14 Sep 2023 10:43:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240159AbjINOnK (ORCPT ); Thu, 14 Sep 2023 10:43:10 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665241BF0; Thu, 14 Sep 2023 07:43:06 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rmg5b623lz6K5pK; Thu, 14 Sep 2023 22:42:27 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 14 Sep 2023 15:43:03 +0100 Date: Thu, 14 Sep 2023 15:43:02 +0100 From: Jonathan Cameron To: James Morse CC: , , , , , , , , , Salil Mehta , Russell King , Jean-Philippe Brucker , , Subject: Re: [RFC PATCH v2 26/35] arm64: acpi: Move get_cpu_for_acpi_id() to a header Message-ID: <20230914154302.00001c11@Huawei.com> In-Reply-To: <20230913163823.7880-27-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-27-james.morse@arm.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 07:43:17 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On Wed, 13 Sep 2023 16:38:14 +0000 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 Seems reasonable Reviewed-by: Jonathan Cameron > --- > 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 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) > {