From mboxrd@z Thu Jan 1 00:00:00 1970 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 C373DE95A8E for ; Mon, 9 Oct 2023 12:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:CC:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7x2Hzn0UVeRFxCJbzNH88AT/r9CwIowaPhIeJpfxZN0=; b=xwFNO7+hRB43AynZZ2juk75PAn KXAvnJWqEVJuVGheVLzrZfauHJI2AZWYHV0Cf6iCRhjHdAr8P4nYEni8l+J+CpFV3rvLzRMhSlAWl GeqbMlOnKZB1nCq7iButJq3hc4k4UbYt/bklZq69aBswjV9x+Sj2wIOBG2TcLHxa+sMvkUPEr8o92 4hJInnoLhUauYrkJMQ3GUtLzhHVnjhyhj5xOi2ka6WZKhYJ94Me/vDiwD4xFxCUEPsLxdgDn+pOGi dmKdsbLdG2ZGi5yj7JR6uldZzPyc5RGHr8e1jhAZEXKQfxX9CAJttmws0XcwJgHSaSwNPgLsvqK59 Bg7t7G2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qppOg-00AggJ-1n; Mon, 09 Oct 2023 12:30:06 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qppOa-00AgYJ-2o for linux-arm-kernel@lists.infradead.org; Mon, 09 Oct 2023 12:30:05 +0000 Received: from dggpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S3yv33wNrzVlVl; Mon, 9 Oct 2023 20:26:23 +0800 (CST) Received: from [10.174.178.247] (10.174.178.247) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 9 Oct 2023 20:29:50 +0800 Subject: Re: [PATCH v2] ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init() To: D Scott Phillips , Sudeep Holla , , CC: Lorenzo Pieralisi , "Rafael J . Wysocki" , "Rafael J . Wysocki" , Robin Murphy References: <20230606093531.2746732-1-sudeep.holla@arm.com> <867cnzqojo.fsf@scott-ph-mail.amperecomputing.com> From: Hanjun Guo Message-ID: <00dd9623-a131-53ed-5e73-1eccd626d2d7@huawei.com> Date: Mon, 9 Oct 2023 20:29:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <867cnzqojo.fsf@scott-ph-mail.amperecomputing.com> Content-Language: en-GB X-Originating-IP: [10.174.178.247] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231009_053001_470513_EFF7F053 X-CRM114-Status: GOOD ( 16.37 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2023/10/7 8:11, D Scott Phillips wrote: > Sudeep Holla writes: > >> Move all of the ARM-specific initialization into one function namely >> acpi_arm_init(), so it is not necessary to modify/update bus.c every >> time a new piece of it is added. >> >> Cc: Lorenzo Pieralisi >> Cc: Rafael J. Wysocki >> Suggested-by: Rafael J. Wysocki >> Reviewed-by: Robin Murphy >> Reviewed-by: Hanjun Guo >> Link: https://lore.kernel.org/r/CAJZ5v0iBZRZmV_oU+VurqxnVMbFN_ttqrL=cLh0sUH+=u0PYsw@mail.gmail.com >> Signed-off-by: Sudeep Holla >> --- >> drivers/acpi/arm64/Makefile | 2 +- >> drivers/acpi/arm64/agdi.c | 2 +- >> drivers/acpi/arm64/apmt.c | 2 +- >> drivers/acpi/arm64/init.c | 13 +++++++++++++ >> drivers/acpi/arm64/init.h | 6 ++++++ >> drivers/acpi/arm64/iort.c | 1 + >> drivers/acpi/bus.c | 7 +------ >> include/linux/acpi.h | 6 ++++++ >> include/linux/acpi_agdi.h | 13 ------------- >> include/linux/acpi_apmt.h | 19 ------------------- >> include/linux/acpi_iort.h | 2 -- >> 11 files changed, 30 insertions(+), 43 deletions(-) >> create mode 100644 drivers/acpi/arm64/init.c >> create mode 100644 drivers/acpi/arm64/init.h >> delete mode 100644 include/linux/acpi_agdi.h >> delete mode 100644 include/linux/acpi_apmt.h [...] >> diff --git a/drivers/acpi/arm64/init.c b/drivers/acpi/arm64/init.c >> new file mode 100644 >> index 000000000000..d3ce53dda122 >> --- /dev/null >> +++ b/drivers/acpi/arm64/init.c >> @@ -0,0 +1,13 @@ >> +// SPDX-License-Identifier: GPL-2.0-only >> +#include >> +#include "init.h" >> + >> +void __init acpi_arm_init(void) >> +{ >> + if (IS_ENABLED(CONFIG_ACPI_AGDI)) >> + acpi_agdi_init(); >> + if (IS_ENABLED(CONFIG_ACPI_APMT)) >> + acpi_apmt_init(); >> + if (IS_ENABLED(CONFIG_ACPI_IORT)) >> + acpi_iort_init(); >> +} [...] >> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c >> index d161ff707de4..7a1eaf8c7bde 100644 >> --- a/drivers/acpi/bus.c >> +++ b/drivers/acpi/bus.c >> @@ -26,9 +26,6 @@ >> #include >> #include >> #endif >> -#include >> -#include >> -#include >> #include >> #include >> #include >> @@ -1408,7 +1405,7 @@ static int __init acpi_init(void) >> acpi_init_ffh(); >> >> pci_mmcfg_late_init(); >> - acpi_iort_init(); >> + acpi_arm_init(); >> acpi_viot_early_init(); >> acpi_hest_init(); >> acpi_ghes_init(); >> @@ -1420,8 +1417,6 @@ static int __init acpi_init(void) >> acpi_debugger_init(); >> acpi_setup_sb_notify_handler(); >> acpi_viot_init(); >> - acpi_agdi_init(); >> - acpi_apmt_init(); > > Hi Sudeep, this moves acpi_agdi_init() before acpi_ghes_init(). > sdei initialization currently happens from ghes_init, so agdi devices > using SDEI can no longer probe: > > | [ 0.515864] sdei: Failed to create event 1073741825: -5 > | [ 0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825 > | [ 0.515867] agdi: probe of agdi.0 failed with error -5 > | ... > | [ 0.516022] sdei: SDEIv1.0 (0x0) detected in firmware. How about just move acpi_arm_init() to the place of after acpi_ghes_init()? I checked the functions in acpi_arm_init(), there are no other dependencies except sdei_init(). Thanks Hanjun _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel