Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1288129pxb; Fri, 21 Jan 2022 14:26:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8QZaG7dYneC6YH6Pn5d3nDV4oJcAMy6l8CXPV0MWJtA9gtq7DD10ow5Az360atZq82iDg X-Received: by 2002:a65:6ab3:: with SMTP id x19mr4297995pgu.416.1642803990964; Fri, 21 Jan 2022 14:26:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642803990; cv=none; d=google.com; s=arc-20160816; b=WNm/vaSk6x7j7pvqlsPGbBP1ni/uHIlYu2SxRzhxOPsZf0/YeuN3+7isar/yZsdNCR VRMREL1GR1JBjgmYKA27zjZ8lcwuhsRQJrVInUBVPUNA/b6ZwpfddI3fL+FYB30TzBrC t4FAS35lhN6cAlG6vGy5VfIFPbzg1aErVdhK0ea/3IsnlwN/bLyZfPIaci+56OgZFugB vuTJUITObGF66HOY2mFe73B2LHmWQO8YwEP10JMiFumu+ZQIYQXM4Z8Yqq/j6urP2wXG U09BNtASd/ezlVmcHYKM/hyBQO27no8gFtGavtCiIxYoiTTqyJnRIbBSCAuaCQ3vGQXt tQVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=81lHmxPrNSJfRoHu/0NzyOOMey+E0oGeyZwxZUvz0xw=; b=jYQp+MCgAZ79hu7y/RQrRuaW9QcR9mZq3FvaPa9pCH8DOokMTX3bwgXz120YSt4hCL J6zFTMCD29c+E9dgbZV2F1eEmB5uZQXsBbmyDoAqdqjkaKj401jWCXEEfjl+enBoKaoj 9cnj8jUFjCymN3b3+sh0/3xWN/DeZTGlSPeKzSQHZCT4Ga+UDlzklZLrXYeCIJ1Oz977 DD6I3lO0F45C3jbI1peIhflzgnoDKB66/buUvxqPwKeuiAX/9AFucA9cPMZ9z5iQfC6K XfWuekkTS9URMt/R+WD7ml17YfoK3tSMGHYR8iRtVFEEO3JTdupxed0iGMVuSwUoP83U OqbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si7852913plg.66.2022.01.21.14.26.18; Fri, 21 Jan 2022 14:26:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377083AbiATQid (ORCPT + 99 others); Thu, 20 Jan 2022 11:38:33 -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-kernel@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/