From patchwork Wed Aug 7 06:36:12 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: 13755679 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 87568C3DA7F for ; Wed, 7 Aug 2024 06:39:31 +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=5WaIhohu/4SS8FUNg8bHs6L9F9IeKtMmsKnmeykwUxg=; b=h293ER28VulVNFsWdgW1pMzt+p co2vf4Wd6tOWMMCN7nKnb+clLZnC3iZjC+qVQ2rytqkCs1hY2jhydVEw1POxuPp8irGllRezdgFo7 Ap6P+0vkDVyz5Q33mSVfMOwaCMEPSGYqSDk0rgJEU6X3EiyFtvrzLReyCrzeTFq41bE6yCEvtNgK5 NgLDTN/cCQvBIqKh7yz6VuRTETg1b6z0DJAJpDSRxtcYGoYBn2Y5lMGDAuhacFmZxKzu/OVg0J+/I Q6br3FgL6qBRMNyZSWy5eqicH2CKfUdOY7IDJocUeYZYJT7qVGbzyQYs9vaJKSu+DUgG7mMSHaoWu d+10x/pA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbaKN-000000040Lw-2D5N; Wed, 07 Aug 2024 06:39:19 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbaJq-000000040Gw-1QQ8 for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 06:38:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 40B3361170; Wed, 7 Aug 2024 06:38:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id E1E82C32782; Wed, 7 Aug 2024 06:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723012724; bh=uLYUHtEGQLjfak6R41AoA3cjPMFVdYNbZd5bOiIAwUc=; h=From:Date:Subject:To:Cc:Reply-To:From; b=rMN/L43ZJYxvLgE1Nkpd706DKghFRUjY/fuzLiW+JGoys4rvD/+yWETzjEipTdFYO +ECicUW0zHTTJl+9ZWSvL/a3xDFLanSou+tohbww771JLlUiKky4xV0i+orWZyoP7y Q+pNbq9ZGb7baJHouLtqiYc98eetV4jtnKurjgSmIYKUR8wtYyAvBFErGWCHNG5KFg enAJLTaT7T/YsH+Qmj1VnOglfAUulUr1oSx2ICka09JogeP8LVKX6JMsoXLaiWpbLq qRgxxFSJiMfQW7jcQvLAl2BF9U6tIkgSXRATOABzE/dJRpeeSxMq4Ecc3I1c1T0QYF /yjiL8FKi4NKw== 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 D5EE0C52D6F; Wed, 7 Aug 2024 06:38:44 +0000 (UTC) From: Miao Wang via B4 Relay Date: Wed, 07 Aug 2024 14:36:12 +0800 Subject: [PATCH v2] ACPI: introduce acpi_arch_init MIME-Version: 1.0 Message-Id: <20240807-intro-acpi-arch-init-v2-1-9231e23a7721@gmail.com> X-B4-Tracking: v=1; b=H4sIANsVs2YC/x3MQQqAIBBA0avIrBsQi8quEi3ExpqNySgRhHdPW r7F/y9kEqYMi3pB6ObMV2wwnQJ/ungQ8t4MRptBz3pCjkUudD4xOvFnMxcM3tpAfU+j2aGlSSj w82/XrdYPmQDXLGYAAAA= To: Hanjun Guo , "Rafael J. Wysocki" , Len Brown , Sunil V L 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=2274; i=shankerwangmiao@gmail.com; h=from:subject:message-id; bh=PwRtjL6KwaJet/RgRLb11kIQcxlFiQsK9B6kUpBB98I=; b=owEBbQKS/ZANAwAKAbAx48p7/tluAcsmYgBmsxZzDbVLjrRb5y9D3vj5+ZJtq/uQt1buMk2J0 yY/VdwFnQ2JAjMEAAEKAB0WIQREqPWPgPJBxluezBOwMePKe/7ZbgUCZrMWcwAKCRCwMePKe/7Z bmhTD/0awF1iZkM4M3/RJ8uH0JLx9//MZ+4UbNQ/bk3rkzyx7eeYjW3yzIipcptQl2czV5bH4TK UHthyGbyJXXHnTSt9C7yv3lXmhVOxaLaJ0WvEWr6lxaW5HOL/5YPyQK5FlepvuHt917CcWxnN9P 02fpZJbMVs4j2injz1uak/OMxzVP0+3dXFsw5wSRUMBjLvOAu3hw8WujVsKtJ3nQZH6eVqwxV9u Fpylxrqy5kvtMbrJ53/WUdNO0v9GUM2tmYX5TgBgnVHLXN15BNyHfMGSvjllG3GVRwFyhc+Fq23 Q0gt7UqiY3lAb8+9vJ98IAbORIV53J3IjCZghu6kp/NLxP6s+pZyCg7Gnqk9G+S13kB69Y12jKf eEXbEhAAk/XVmBIvZcy/0r6Hh9Z7WlXcCN1H0seCikEmNEkkb9XJWGFPR3moPIjZYzdnIPXRIuW rpZMkkCHBTA1TM94iaSAfLCnWZ/vvvU9yQUPBR1nke6358Kq3zlbFqhJ975oI3dnBBKbG6e88aq iu2CDJV9P0aJtaJC0IQ4YjkdsNcvbdS45NBU+c3kC5Ib2QGBd1azGc3lg6kbrdpnd+u81HPxVit PXlDa0IR+autUP1X/f7hjdKTB3KlXEcJh2R9NDrZravfs5aSA3uCvfK54HS17DahgMAz+pdjYLj 67jgYqyHg1TNIDw== 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-20240806_233846_507882_7244437F X-CRM114-Status: GOOD ( 12.10 ) 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 --- Changes from v1 - Change acpi_arch_init from a static inline stub to a weak function according to Haijun Guo's advice --- 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..b47541e45a5a 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 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);