From patchwork Thu Aug 8 13:15:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 13757464 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 D2B19C3DA4A for ; Thu, 8 Aug 2024 13:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p2lFCjlhSb/+rk/ykIue6n/P0kBQ+xOXBjkne39LGUM=; b=ApXAcdh53Xnlxlz+gX80HxmYMm hzIryw2O50YyC4C113D9e8A57EYR2GbmFCKEoJ9H1tiKWbrPDjdF/zB2uiq6vf1LhsH2tSzjsBggJ AE6s3ubMFmPYCAB+sk6w/30bZMSNxTJsWWt5yqNeaWz60kjWhOW4ufVJQRSRhRLqjNyRfhw5JmW8K YqpJpf8nh+ZjRUYxN2HzopQeDaKY+PPUTqgqn8Ur+Y89iDW2K9nTvLX9m9WJC76LJS0kjxTBbcey3 hgVSqWdcmsq10ceSv6kOHJWHF8YUI65LWcerD/VZ7radoakbG8tF+aTypYTQ2yAmIpmnPe9q0nLlL 7Q9UrK0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc30B-00000008LLY-1dVj; Thu, 08 Aug 2024 13:16:23 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc2zb-00000008LFz-3cZ2 for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 13:15:49 +0000 Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WfnYW5kkgzDqVY; Thu, 8 Aug 2024 21:13:51 +0800 (CST) Received: from dggpemf500002.china.huawei.com (unknown [7.185.36.57]) by mail.maildlp.com (Postfix) with ESMTPS id 338201402CC; Thu, 8 Aug 2024 21:15:46 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemf500002.china.huawei.com (7.185.36.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 8 Aug 2024 21:15:45 +0800 From: Hanjun Guo To: Sudeep Holla , Lorenzo Pieralisi , "Rafael J . Wysocki" CC: Will Deacon , Catalin Marinas , , , Hanjun Guo Subject: [PATCH 3/3] ARM64: ACPI: Move the NUMA code to drivers/acpi/arm64/ Date: Thu, 8 Aug 2024 21:15:22 +0800 Message-ID: <20240808131522.1032431-4-guohanjun@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240808131522.1032431-1-guohanjun@huawei.com> References: <20240808131522.1032431-1-guohanjun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemf500002.china.huawei.com (7.185.36.57) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_061548_233609_107D3675 X-CRM114-Status: GOOD ( 12.65 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The ARM64 ACPI NUMA code can be moved out of arm64 arch code as it just related to ACPI NUMA table parsing, mappings for ACPI NUMA and cpu, move the ACPI NUMA code to drivers/acpi/arm64/. Since arm64 selects ACPI_NUMA by default, so just move the function definitions under CONFIG_ARM64 in linux/acpi.h. Signed-off-by: Hanjun Guo --- arch/arm64/include/asm/acpi.h | 8 -------- arch/arm64/kernel/Makefile | 1 - drivers/acpi/arm64/Makefile | 1 + {arch/arm64/kernel => drivers/acpi/arm64}/acpi_numa.c | 0 include/linux/acpi.h | 4 ++++ 5 files changed, 5 insertions(+), 9 deletions(-) rename {arch/arm64/kernel => drivers/acpi/arm64}/acpi_numa.c (100%) diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 5e25110ad1b7..572355783971 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -174,14 +174,6 @@ static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr) } #endif /* CONFIG_ACPI_APEI */ -#ifdef CONFIG_ACPI_NUMA -int acpi_numa_get_nid(unsigned int cpu); -void acpi_map_cpus_to_nodes(void); -#else -static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; } -static inline void acpi_map_cpus_to_nodes(void) { } -#endif /* CONFIG_ACPI_NUMA */ - #define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE #endif /*_ASM_ACPI_H*/ diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 2b112f3b7510..c7d09c6348a4 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -52,7 +52,6 @@ obj-$(CONFIG_EFI) += efi.o efi-rt-wrapper.o obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o obj-$(CONFIG_ACPI) += acpi.o -obj-$(CONFIG_ACPI_NUMA) += acpi_numa.o obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL) += acpi_parking_protocol.o obj-$(CONFIG_PARAVIRT) += paravirt.o obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o diff --git a/drivers/acpi/arm64/Makefile b/drivers/acpi/arm64/Makefile index 05ecde9eaabe..9aeed2e4ebde 100644 --- a/drivers/acpi/arm64/Makefile +++ b/drivers/acpi/arm64/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_ACPI_APMT) += apmt.o obj-$(CONFIG_ACPI_FFH) += ffh.o obj-$(CONFIG_ACPI_GTDT) += gtdt.o obj-$(CONFIG_ACPI_IORT) += iort.o +obj-$(CONFIG_ACPI_NUMA) += acpi_numa.o obj-$(CONFIG_ACPI_PROCESSOR_IDLE) += cpuidle.o obj-$(CONFIG_ARM_AMBA) += amba.o obj-y += dma.o init.o diff --git a/arch/arm64/kernel/acpi_numa.c b/drivers/acpi/arm64/acpi_numa.c similarity index 100% rename from arch/arm64/kernel/acpi_numa.c rename to drivers/acpi/arm64/acpi_numa.c diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 0687a442fec7..7de4e9dac0c7 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -253,8 +253,12 @@ static inline void acpi_arch_dma_setup(struct device *dev) { } #endif #ifdef CONFIG_ARM64 +int acpi_numa_get_nid(unsigned int cpu); +void acpi_map_cpus_to_nodes(void); void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa); #else +static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; } +static inline void acpi_map_cpus_to_nodes(void) { } static inline void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { } #endif