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 8A0E2E7B604 for ; Wed, 4 Oct 2023 12:52:14 +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=TJQAa/N2xEoZMxjPLwKrO9dn2NPG7aKZ0UB89tU9tYs=; b=4Z90J1BRwGl2Cy +mHvKgv9FC5GwJiDl7fEjNQ//nk1NqdNJsnAdYkjKzME/SEC/Xcgz2IDuiLIbVBG/r0f2FTgXPaS2 eIqvT8Rvg+b7tWhmclisLRyr6oG6iAvqcleXfQd68a+X2dF1T1rUBJmAV8TGcCZoZ2OLLpVOILvrd mpmubh3cPx9QPrgf+6/yD0sqUKOaAwWnatEQT+OKZa4EDLRVPGgrZ/zmLrIfqud88933telULt3Vw WtTbsO2uaQIls4wOeddb0Y+wi2ftI8DYhaH5Y0hEqEIuFcuH8v9fIQgW7O0niJaX54CeAUaOi0ucc SP/X76CZ3zKDwVZQmW1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qo1Lw-0003Z0-1Q; Wed, 04 Oct 2023 12:51:48 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qo1Lt-0003XZ-2j for linux-arm-kernel@lists.infradead.org; Wed, 04 Oct 2023 12:51:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 82FABB81D9D; Wed, 4 Oct 2023 12:51:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F7BCC433C7; Wed, 4 Oct 2023 12:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696423902; bh=DWJ81lm9HCoDsSMA7UMPwROL0++RNp9iG5oEiXDUaxM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2Vyq+iiVtwiO5k4OStEx80RScBzFIqSrSt32GEE9UdSRcwsGRVX/Q6QCjBBJKY/63 UomezbFgm/d4u4ALKwBsZyl46EPxDPuRRzs4FL9EjH+Q3C/8452MZVY6+wiXm3aqnw z/J+w41VyVP4kgB6bUi2Vh5iFSFgezBaI2lcgVC4= Date: Wed, 4 Oct 2023 14:51:39 +0200 From: Greg KH To: "Buddhabhatti, Jay" Cc: "Simek, Michal" , "Shah, Tanmay" , "Manne, Nava kishore" , "Levinsky, Ben" , "robh@kernel.org" , "marex@denx.de" , "Shaikh, Izhar Ameer" , "arnd@arndb.de" , "ruanjinjie@huawei.com" , "mathieu.poirier@linaro.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2 4/6] drivers: soc: xilinx: Fix error message on SGI registration failure Message-ID: <2023100441-blouse-quickness-9389@gregkh> References: <20231004094116.27128-1-jay.buddhabhatti@amd.com> <20231004094116.27128-5-jay.buddhabhatti@amd.com> <2023100425-chivalry-pound-78d0@gregkh> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231004_055146_187038_83436218 X-CRM114-Status: GOOD ( 31.80 ) 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 Wed, Oct 04, 2023 at 12:48:25PM +0000, Buddhabhatti, Jay wrote: > Hi Greg, > > > -----Original Message----- > > From: Greg KH > > Sent: Wednesday, October 4, 2023 5:45 PM > > To: Buddhabhatti, Jay > > Cc: Simek, Michal ; Shah, Tanmay > > ; Manne, Nava kishore > > ; Levinsky, Ben ; > > robh@kernel.org; dhaval.r.shah@amd.com; marex@denx.de; Shaikh, Izhar > > Ameer ; arnd@arndb.de; > > ruanjinjie@huawei.com; mathieu.poirier@linaro.org; linux- > > kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org > > Subject: Re: [PATCH v2 4/6] drivers: soc: xilinx: Fix error message on SGI > > registration failure > > > > On Wed, Oct 04, 2023 at 02:41:14AM -0700, Jay Buddhabhatti wrote: > > > Failure to register SGI for firmware event notification is non-fatal > > > error when feature is not supported by other modules such as Xen and > > > TF-A. Add _info level log message for such special case. > > > > > > Also add XST_PM_INVALID_VERSION error code and map it to -EOPNOSUPP > > > Linux kernel error code. If feature is not supported or EEMI API > > > version is mismatch, firmware can return XST_PM_INVALID_VERSION = 4 or > > > XST_PM_NO_FEATURE = 19 error code. > > > > > > Co-developed-by: Tanmay Shah > > > Signed-off-by: Tanmay Shah > > > Signed-off-by: Jay Buddhabhatti > > > --- > > > drivers/firmware/xilinx/zynqmp.c | 4 +++- > > > drivers/soc/xilinx/xlnx_event_manager.c | 7 ++++++- > > > include/linux/firmware/xlnx-zynqmp.h | 1 + > > > 3 files changed, 10 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/firmware/xilinx/zynqmp.c > > > b/drivers/firmware/xilinx/zynqmp.c > > > index 00ea2508f692..de09d77cf1e4 100644 > > > --- a/drivers/firmware/xilinx/zynqmp.c > > > +++ b/drivers/firmware/xilinx/zynqmp.c > > > @@ -92,6 +92,8 @@ static int zynqmp_pm_ret_code(u32 ret_status) > > > return 0; > > > case XST_PM_NO_FEATURE: > > > return -ENOTSUPP; > > > + case XST_PM_INVALID_VERSION: > > > + return -EOPNOTSUPP; > > > case XST_PM_NO_ACCESS: > > > return -EACCES; > > > case XST_PM_ABORT_SUSPEND: > > > @@ -379,7 +381,7 @@ int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset) > > > > > > ret = zynqmp_pm_invoke_fn(TF_A_PM_REGISTER_SGI, sgi_num, reset, > > 0, 0, > > > 0, NULL); > > > - if (!ret) > > > + if (ret != -EOPNOTSUPP && !ret) > > > return ret; > > > > > > /* try old implementation as fallback strategy if above fails */ > > > diff --git a/drivers/soc/xilinx/xlnx_event_manager.c > > > b/drivers/soc/xilinx/xlnx_event_manager.c > > > index 38cfc161a713..bfa5cf4a0cab 100644 > > > --- a/drivers/soc/xilinx/xlnx_event_manager.c > > > +++ b/drivers/soc/xilinx/xlnx_event_manager.c > > > @@ -653,7 +653,12 @@ static int xlnx_event_manager_probe(struct > > > platform_device *pdev) > > > > > > ret = zynqmp_pm_register_sgi(sgi_num, 0); > > > if (ret) { > > > - dev_err(&pdev->dev, "SGI %d Registration over TF-A failed with > > %d\n", sgi_num, ret); > > > + if (ret == -EOPNOTSUPP) > > > + dev_info(&pdev->dev, "PM firmware event notification > > not > > > +supported\n"); > > > > Why is this "info"? Why not error? > [Jay] Because it is non-fatal error which will not cause kernel crash. Neither do dev_err() messages :) And something failed, this isn't just "here's some nice information", it is "something went wrong" which should be a warning or error in my opinion. > > And what is userspace supposed to do with this information if it sees it? > [Jay] This message indicates that SGI registration is not supported by other modules like TF-A or Xen. So user need to use TF-A with this support if they want to use event management driver. So perhaps say that here too? Otherwise how are they supposed to know that? thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel