From patchwork Thu Aug 8 09:00:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Wang via B4 Relay X-Patchwork-Id: 13757127 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 51B1BC3DA4A for ; Thu, 8 Aug 2024 09:05: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:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=TNl0wzg6zSgYl2VvvRi5vorVlgPjs4YbDNS2qAh2FuE=; b=4qvWAPG7Xg4wiVWkcQj4E0+Y9X wrXgkXD4jUQ9i1q2PL9zRrFV+m0MYW+qz9T9BCqGikokOKr9BeBUx4rAROkOYZHPKkT4wgrLiXYv3 60iCH2kPKbfVoeYaxIL7qB/v26hozGpv2FD4eRdIJoLprAdetUsPE9EgktWLKsjzdKtemrtgqCLLJ eC9j4nDymoFbVSmzFY4/eGb6wJR/eBT8NOFUNUdm18g2bzz9g+W0biM/GW1LtovpOvWbxScpx4fsr C7I+JD8RkXukviYI1vGI6JrQLJFI1JwXFXBI+BdDibb5pZl6tpL+TrbFOAM/oA2DZzpkns5Ky8WBx S7D5A/pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbz51-00000007fOf-0591; Thu, 08 Aug 2024 09:05:07 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbz4R-00000007fFu-2UVp for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 09:04:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A9BAFCE10B5; Thu, 8 Aug 2024 09:04:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id EAD86C4AF09; Thu, 8 Aug 2024 09:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723107869; bh=73jc9FS5jqQHvRtTyBvoOGTu/zej/WeDiSMhHV2bKfM=; h=From:Date:Subject:To:Cc:Reply-To:From; b=FADqStcQNxEnjbpSii41yVt/5hZ/gas7oqyJUgWvKoege1POyxgDPX80FNX2hT2W5 nnpNuOkvAhRPNpPmxl4YKCHRBzbvQcc9izkcKhRrwd8bST32GmHTL15//k+Y5Ilnfc Qe3O/eXDfJY8RORAfoWK243MlIKlaUWPD5SqPusCg5Sg8dTCIqUoRxwztvhmgOfYzQ xHTPuSigTDxjqRGE8kGrEZ6mcqt1q1qyDGmKCYEKD24XtHnHd0uE08K01GDwx9pmMp TIY3aZbq3FtkVHvzApvT5qCg6QLJhgcoADT9aQdrerA66AjIfd6nwDrHD2KNt0CZSL AGIGj+eketlHw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D19B0C52D71; Thu, 8 Aug 2024 09:04:28 +0000 (UTC) From: Miao Wang via B4 Relay Date: Thu, 08 Aug 2024 17:00:55 +0800 Subject: [PATCH v3] ACPI: introduce acpi_arch_init MIME-Version: 1.0 Message-Id: <20240808-intro-acpi-arch-init-v3-1-ba510859baff@gmail.com> X-B4-Tracking: v=1; b=H4sIAEaJtGYC/4XNQQrCMBAF0KuUWTvSTsRYV95DugjppB2wTUlCU ErubuwFXL4P//8dIgfhCPdmh8BZovi1Qp0asLNZJ0YZq4FaurS3VqOsKXg0dhM0wc7VktDZvne sFF9phFrdAjt5H7PPoXqWmHz4HC+ZfumfwUzYYU+qY1JGa+oe02LkdbZ+gaGU8gWP0skDuAAAA A== To: Hanjun Guo , "Rafael J. Wysocki" , Len Brown , Sunil V L , Sudeep Holla Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Miao Wang X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2560; i=shankerwangmiao@gmail.com; h=from:subject:message-id; bh=eKOgTF8VhVeyKx0G1xa3uOLgNoi2NBf8PN9xLUwoWag=; b=owEBbQKS/ZANAwAKAbAx48p7/tluAcsmYgBmtIoacnmHXtf/2yn3WwFHLaPfqaWJRBUEo9FMx oRyn4yL9QCJAjMEAAEKAB0WIQREqPWPgPJBxluezBOwMePKe/7ZbgUCZrSKGgAKCRCwMePKe/7Z bnXBD/9pCBlIeUwE6hPCimjF22yrOgvcpqPQdiTygNgjLR8kd0BrfMtvQoouGoEAZFv5xGGVnZV 2Y3dmmhvJP1l51duLAp+0buDO53GW1LKsKyKEptBjPwUglSuTzfHMG/AlH3Eh28FE+Wh1S1OR5y GRhhfVcUxat623ZmGuzAZBtwEZx2caAr6dC9l5W/VR1yOFHXhwoPjawoTBoU1CFawnVJfwWAzjL DXrnCBkaigLmgd70itGi9zJL4POJVge6cf8JjpfTrZXdXezPQCXQNAkIUoYl8vKPinh89Gu0qqC WH6oydsVNbp1SnUlHgijuxcZtfvh6vN1wP8iCmHRwRvR2rXq/lw/Z/vfwPy1BJCXwOMFQxXq2gt +1bYVHi6NJKBQEK0EiCp9qzxEMa0iaW3SbpXND+osw62DYzZSbmunq6Obf+zN9sbheQXDRsy+48 y8aU8bIpQcxKW1A8mKPPUuC57Kc5r/ywhklp+nfJP9R4eNF6ij/D6cwKjw93Jk/RuehUau93uwh i2+i0ot9N1WHBCxHnglLXWC/AlPsu2RI2V9H/7+deGG6ZjjL5SoWEX8MUJNQQh8SXj/7CSDPmAQ T0zlH/aLkevO/hfC4JTb5h+fmHJvTf7Uf896qSt3wvwa3J7HPxvI+oQptRurUTlFXlVDzXpZ4TN iz9huz55A7n6bjg== X-Developer-Key: i=shankerwangmiao@gmail.com; a=openpgp; fpr=6FAEFF06B7D212A774C60BFDFA0D166D6632EF4A X-Endpoint-Received: by B4 Relay for shankerwangmiao@gmail.com/default with auth_id=189 X-Original-From: Miao Wang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_020432_086992_330A313A X-CRM114-Status: GOOD ( 12.71 ) 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: , Reply-To: shankerwangmiao@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Miao Wang To avoid arch-specific code in general ACPI initialization flow, we introduce a weak symbol acpi_arch_init. Currently, arm64 can utillize this to insert its specific flow. In the future, other architectures can also have chance to define their own arch-specific acpi initialization process if necessary. Signed-off-by: Miao Wang Reviewed-by: Sunil V L Reviewed-by: Sudeep Holla Acked-by: Hanjun Guo --- Changes from v1 - Change acpi_arch_init from a static inline stub to a weak function according to Haijun Guo's advice --- Changes from v2: - Add __init attribute to the weak acpi_arch_init stub - Link to v2: https://lore.kernel.org/r/20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com --- drivers/acpi/arm64/init.c | 2 +- drivers/acpi/bus.c | 4 +++- include/linux/acpi.h | 6 +----- 3 files changed, 5 insertions(+), 7 deletions(-) --- base-commit: d4560686726f7a357922f300fc81f5964be8df04 change-id: 20240807-intro-acpi-arch-init-fc99fe33e62d Best regards, diff --git a/drivers/acpi/arm64/init.c b/drivers/acpi/arm64/init.c index d0c8aed90fd1..7a47d8095a7d 100644 --- a/drivers/acpi/arm64/init.c +++ b/drivers/acpi/arm64/init.c @@ -2,7 +2,7 @@ #include #include "init.h" -void __init acpi_arm_init(void) +void __init acpi_arch_init(void) { if (IS_ENABLED(CONFIG_ACPI_AGDI)) acpi_agdi_init(); diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 284bc2e03580..3b319b163d82 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -1431,6 +1431,8 @@ static int __init acpi_bus_init(void) struct kobject *acpi_kobj; EXPORT_SYMBOL_GPL(acpi_kobj); +void __weak __init acpi_arch_init(void) { } + static int __init acpi_init(void) { int result; @@ -1458,7 +1460,7 @@ static int __init acpi_init(void) acpi_viot_early_init(); acpi_hest_init(); acpi_ghes_init(); - acpi_arm_init(); + acpi_arch_init(); acpi_scan_init(); acpi_ec_init(); acpi_debugfs_init(); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 0687a442fec7..52862c377747 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1523,11 +1523,7 @@ static inline int find_acpi_cpu_topology_hetero_id(unsigned int cpu) } #endif -#ifdef CONFIG_ARM64 -void acpi_arm_init(void); -#else -static inline void acpi_arm_init(void) { } -#endif +void acpi_arch_init(void); #ifdef CONFIG_ACPI_PCC void acpi_init_pcc(void);