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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B48AFC433F5 for ; Thu, 20 Jan 2022 16:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377000AbiATQi2 (ORCPT ); Thu, 20 Jan 2022 11:38:28 -0500 Received: from foss.arm.com ([217.140.110.172]:44576 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376980AbiATQi2 (ORCPT ); Thu, 20 Jan 2022 11:38:28 -0500 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 0A7FDED1; Thu, 20 Jan 2022 08:38:28 -0800 (PST) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 39FC53F73D; Thu, 20 Jan 2022 08:38:26 -0800 (PST) Date: Thu, 20 Jan 2022 16:38:19 +0000 From: Lorenzo Pieralisi To: Ilkka Koskinen Cc: guohanjun@huawei.com, sudeep.holla@arm.com, rafael@kernel.org, linux@armlinux.org.uk, lenb@kernel.org, robert.moore@intel.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, patches@amperecomputing.com, scott@os.amperecomputing.com, darren@os.amperecomputing.com, james.morse@arm.com Subject: Re: [PATCH v3 2/2] ACPI: AGDI: Add driver for Arm Generic Diagnostic Dump and Reset device Message-ID: <20220120163819.GA8187@lpieralisi> References: <20211231033725.21109-1-ilkka@os.amperecomputing.com> <20211231033725.21109-3-ilkka@os.amperecomputing.com> <20220105104602.GA4752@lpieralisi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Thu, Jan 13, 2022 at 06:17:13PM -0800, Ilkka Koskinen wrote: > > Hi Lorenzo, > > On Wed, 5 Jan 2022, Ilkka Koskinen wrote: > > > > Hi Lorenzo, > > > > On Wed, 5 Jan 2022, Lorenzo Pieralisi wrote: > > > [+James, for SDEI bits] > > > > > > On Thu, Dec 30, 2021 at 07:37:25PM -0800, Ilkka Koskinen wrote: > > > > ACPI for Arm Components 1.1 Platform Design Document v1.1 [0] specifices > > > > Arm Generic Diagnostic Device Interface (AGDI). It allows an admin to > > > > issue diagnostic dump and reset via an SDEI event or an interrupt. > > > > This patch implements SDEI path. > > > > > > > > [0] https://developer.arm.com/documentation/den0093/latest/ > > > > > > > > Signed-off-by: Ilkka Koskinen > > > > --- > > > > drivers/acpi/arm64/Kconfig | 8 +++ > > > > drivers/acpi/arm64/Makefile | 1 + > > > > drivers/acpi/arm64/agdi.c | 125 ++++++++++++++++++++++++++++++++++++ > > > > 3 files changed, 134 insertions(+) > > > > create mode 100644 drivers/acpi/arm64/agdi.c > > > > > > > diff --git a/drivers/acpi/arm64/agdi.c b/drivers/acpi/arm64/agdi.c > > > > new file mode 100644 > > > > index 000000000000..6525ccbae5c1 > > > > --- /dev/null > > > > +++ b/drivers/acpi/arm64/agdi.c > > > > > > > > > > > +static int __init agdi_init(void) > > > > +{ > > > > + int ret; > > > > + acpi_status status; > > > > + struct acpi_table_agdi *agdi_table; > > > > + struct agdi_data pdata; > > > > + struct platform_device *pdev; > > > > + > > > > + if (acpi_disabled) > > > > + return 0; > > > > > > Why don't we call agdi_init() from acpi_init() as we do for IORT/VIOT ? > > > > > > I don't think it is necessary to add a device_initcall(), with related > > > ordering dependencies. > > > > That's a good point. I change it. > > Actually, I looked at this more carefully. acpi_init() is called in > subsys_initcall() while sdei_init() is called in subsys_initcall_sync(). > That is, if I call this function in acpi_init(), SDEI driver won't be ready > and this driver fails to register the event. Maybe this will help: https://lore.kernel.org/linux-arm-kernel/20220120050522.23689-1-xueshuai@linux.alibaba.com/ 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 C67C7C433F5 for ; Thu, 20 Jan 2022 16:39:44 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AFjbwi6dVMVvMKsnKe4vWQpNOlscyLh4+JR2snITOnc=; b=IiY4SBa6wths1i tnjwD3+L7FWoZ7+Js6tXJLugYYIpdjAbHwiUym+U0/OY572iZ4fdwoDIRCUaP8RZoaahcr5VPA5dC JfgIlp3KR2mIuGliTNKr4ncldmlVpPfjGCvI7WBJEfjshoTVSEbM39IKHWDelOcmwk4MQSeI9j64P /PpSacOgiHiCV0+ahCVPTZDpnaDcsZhJS/uTtFgjhuYnrFKAGeKyAqmBRSikZ//aymOpjnBwIY4iH GiQcTcf7p5do7lKsPA+yVOYSSd2N4v0aC68eye19xB/uXSAQuHjNTujaAGFAa78BQJgPlg0/6b9V4 LeFQq9Mq1PfDwxi2NAnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAaSI-00CQfV-UF; Thu, 20 Jan 2022 16:38:35 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAaSE-00CQbi-Tl for linux-arm-kernel@lists.infradead.org; Thu, 20 Jan 2022 16:38:32 +0000 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 0A7FDED1; Thu, 20 Jan 2022 08:38:28 -0800 (PST) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 39FC53F73D; Thu, 20 Jan 2022 08:38:26 -0800 (PST) Date: Thu, 20 Jan 2022 16:38:19 +0000 From: Lorenzo Pieralisi To: Ilkka Koskinen Cc: guohanjun@huawei.com, sudeep.holla@arm.com, rafael@kernel.org, linux@armlinux.org.uk, lenb@kernel.org, robert.moore@intel.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, patches@amperecomputing.com, scott@os.amperecomputing.com, darren@os.amperecomputing.com, james.morse@arm.com Subject: Re: [PATCH v3 2/2] ACPI: AGDI: Add driver for Arm Generic Diagnostic Dump and Reset device Message-ID: <20220120163819.GA8187@lpieralisi> References: <20211231033725.21109-1-ilkka@os.amperecomputing.com> <20211231033725.21109-3-ilkka@os.amperecomputing.com> <20220105104602.GA4752@lpieralisi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220120_083831_030196_9AD6A42E X-CRM114-Status: GOOD ( 25.54 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 13, 2022 at 06:17:13PM -0800, Ilkka Koskinen wrote: > > Hi Lorenzo, > > On Wed, 5 Jan 2022, Ilkka Koskinen wrote: > > > > Hi Lorenzo, > > > > On Wed, 5 Jan 2022, Lorenzo Pieralisi wrote: > > > [+James, for SDEI bits] > > > > > > On Thu, Dec 30, 2021 at 07:37:25PM -0800, Ilkka Koskinen wrote: > > > > ACPI for Arm Components 1.1 Platform Design Document v1.1 [0] specifices > > > > Arm Generic Diagnostic Device Interface (AGDI). It allows an admin to > > > > issue diagnostic dump and reset via an SDEI event or an interrupt. > > > > This patch implements SDEI path. > > > > > > > > [0] https://developer.arm.com/documentation/den0093/latest/ > > > > > > > > Signed-off-by: Ilkka Koskinen > > > > --- > > > > drivers/acpi/arm64/Kconfig | 8 +++ > > > > drivers/acpi/arm64/Makefile | 1 + > > > > drivers/acpi/arm64/agdi.c | 125 ++++++++++++++++++++++++++++++++++++ > > > > 3 files changed, 134 insertions(+) > > > > create mode 100644 drivers/acpi/arm64/agdi.c > > > > > > > diff --git a/drivers/acpi/arm64/agdi.c b/drivers/acpi/arm64/agdi.c > > > > new file mode 100644 > > > > index 000000000000..6525ccbae5c1 > > > > --- /dev/null > > > > +++ b/drivers/acpi/arm64/agdi.c > > > > > > > > > > > +static int __init agdi_init(void) > > > > +{ > > > > + int ret; > > > > + acpi_status status; > > > > + struct acpi_table_agdi *agdi_table; > > > > + struct agdi_data pdata; > > > > + struct platform_device *pdev; > > > > + > > > > + if (acpi_disabled) > > > > + return 0; > > > > > > Why don't we call agdi_init() from acpi_init() as we do for IORT/VIOT ? > > > > > > I don't think it is necessary to add a device_initcall(), with related > > > ordering dependencies. > > > > That's a good point. I change it. > > Actually, I looked at this more carefully. acpi_init() is called in > subsys_initcall() while sdei_init() is called in subsys_initcall_sync(). > That is, if I call this function in acpi_init(), SDEI driver won't be ready > and this driver fails to register the event. Maybe this will help: https://lore.kernel.org/linux-arm-kernel/20220120050522.23689-1-xueshuai@linux.alibaba.com/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel