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 C493BC7882E for ; Fri, 20 Sep 2024 12:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PjGGCTbX4+M7ZXKcqUKQdynUvYjGIRgh9QgJLadSsYk=; b=EeKGhUOV6SrRc0gaF9jwJespom uybq2/yJb1nnw15R+H12L/mlduR3a9MBKkXskjXyppYzE0gBXAlN3AL9tChxH4pZ+GiztKcU+65Y/ fhqEY1qV5RrAEs8cRaGfpBid8Ojo2C3CxCbvDo/v3yT4cgwDdDK4mTs1YLi5jWohrRHH5gst8ubRv n3XIR3k1NitxhvhJgV/BLXvzgI41LwGPoaTMv6M3IGR8wPrXzrnMNSdDb1zKBHEX324sUw4U6sgDR /tlVvkHELywVmuv+XD1vwq6O32pdzLWUOJyZVZI26LxiJqfKI5+HAuQxP+QAYlix9My6Ol0Nxs9SB iYA7Q/HA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srcMn-0000000C8zW-3toT; Fri, 20 Sep 2024 12:04:05 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srcLf-0000000C8tJ-44c8 for linux-arm-kernel@lists.infradead.org; Fri, 20 Sep 2024 12:02:57 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1srcLA-0000yX-UX; Fri, 20 Sep 2024 14:02:24 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srcLA-000FEL-7y; Fri, 20 Sep 2024 14:02:24 +0200 Received: from sha by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1srcLA-001tQr-0T; Fri, 20 Sep 2024 14:02:24 +0200 Date: Fri, 20 Sep 2024 14:02:24 +0200 From: Sascha Hauer To: Pankaj Gupta Cc: Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [EXT] Re: [PATCH v7 4/5] firmware: imx: add driver for NXP EdgeLock Enclave Message-ID: References: <20240904-imx-se-if-v7-0-5afd2ab74264@nxp.com> <20240904-imx-se-if-v7-4-5afd2ab74264@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240920_050256_029980_0BBE582A X-CRM114-Status: GOOD ( 22.75 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Pankaj, On Thu, Sep 19, 2024 at 06:43:45AM +0000, Pankaj Gupta wrote: > > +static void se_load_firmware(const struct firmware *fw, void > > +*context) { > > + struct se_if_priv *priv = context; > > + const struct se_if_node_info *info = priv->info; > > + phys_addr_t se_fw_phyaddr; > > + u8 *se_fw_buf; > > + int ret; > > + > > + if (!fw) { > > + if (priv->fw_fail > MAX_FW_LOAD_RETRIES) > > + dev_dbg(priv->dev, > > + "External FW not found, using ROM FW.\n"); > > + else { > > + /*add a bit delay to wait for firmware priv released > */ > > + msleep(20); > > + > > + /* Load firmware one more time if timeout */ > > + request_firmware_nowait(THIS_MODULE, > > + FW_ACTION_UEVENT, > priv->se_img_file_to_load, > > + priv->dev, GFP_KERNEL, priv, > > + se_load_firmware); > > + priv->fw_fail++; > > + dev_dbg(priv->dev, "Value of retries = 0x%x.\n", > > + priv->fw_fail); > > + } > > + > > + return; > > + } > > > Are you continuously trying to load the firmware here in the hope that the > rootfs is mounted before your retry counter exceeds? > > Yes. > > > Don't do this. > > Shall the retry counter to be removed, to make it predictable? > Or am I missing something. Either compile the firmware into the kernel or the ELE driver as module. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |