Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3364415rdb; Wed, 13 Sep 2023 09:45:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyzgUxIrY+0OLHaFqjIVEpjP8JQLKnw2aXMqiaONLi0aM+6uyV3V0pigzWzWqCajIbadPX X-Received: by 2002:a05:6871:29d:b0:1d5:5d44:7404 with SMTP id i29-20020a056871029d00b001d55d447404mr3183985oae.43.1694623554449; Wed, 13 Sep 2023 09:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694623554; cv=none; d=google.com; s=arc-20160816; b=mUK++wX7vsyMNb/DDWA79duH65HkesGL0E2ANd1J/9tu8Tv35LhrS21htzgDDN+dY4 /cvA7fS23rIQ1rPLiiIxnl7ZE9aA2HzMG0StGSkxdRT3Yx4mbJWtOlW9f4kqeGoKsYKm xzETznKjwdSfWjYkC4S69wdEO3n3Fes4khRfc8hiqrORNGdHWr579hJb2EShv8rfDuS6 2XJ/UVARnl6B4lHPNfF6qDYR6oHv95gDY50Ee+Xe8puKpgnoSDE9DFwYPqJB86fcMK5Z BsLZn+WKhRnJKTeggyMr3O1z/gNeCYMmf8AjCgAaEzzDV/k+AANPIlO4G6n1VkZD8/Bs 0q+g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KLugWriGX6zqaFgxpxKzTY3Tax57oIOyzp2E96kFWQ4=; fh=2nhVWB0fZ+8YH0lLFpnF/Mo8eq+n1VMLe+b+IpvS0g0=; b=sWOAGAVrAEjfJBpJqAm7hqItQ+xAiY/fQlK6aRSjvYxMZLvERuDgPUPSw1C/Htbhg0 AeSFUahUNFWwZr5KD0PpWwT728IknXwp5RBeMpDsrZlTwNTiE6FPZtHMKOJSBW5zknQ3 S/O95I4TxIcf1Nlli4ClwqTlPFrL3Jz9h5RKpayZvPhHqpDHsa7jvMxt4Nk6PmzbeFGk nyn2gxwLMdnNdVYSxc0PT2kYHk6P2W00HIFlf/2jFQI8PZNodbq1VH8wGUVECRx+P7uS X2vZl8y8oOsrAbFQW8DEbu+1EtWfhpGMTgnFSyS4geJMjE7AEA2qxMi2KTWxwSMJ/qNR L4sw== 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:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l71-20020a63914a000000b005740e906e55si9223758pge.37.2023.09.13.09.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 09:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3CF1E8297C50; Wed, 13 Sep 2023 09:41:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231240AbjIMQl2 (ORCPT + 99 others); Wed, 13 Sep 2023 12:41:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231343AbjIMQki (ORCPT ); Wed, 13 Sep 2023 12:40:38 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76A151FC2; Wed, 13 Sep 2023 09:39:45 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 54D001FB; Wed, 13 Sep 2023 09:40:22 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A1BB3F5A1; Wed, 13 Sep 2023 09:39:43 -0700 (PDT) From: James Morse To: 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, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev Cc: x86@kernel.org, Salil Mehta , Russell King , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com Subject: [RFC PATCH v2 26/35] arm64: acpi: Move get_cpu_for_acpi_id() to a header Date: Wed, 13 Sep 2023 16:38:14 +0000 Message-Id: <20230913163823.7880-27-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913163823.7880-1-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (morse.vger.email [0.0.0.0]); Wed, 13 Sep 2023 09:41:54 -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 morse.vger.email 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 --- 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) { -- 2.39.2