[EXT] Re: [PATCH v7 4/5] firmware: imx: add driver for NXP EdgeLock Enclave

Pankaj Gupta pankaj.gupta at nxp.com
Wed Sep 25 05:00:28 PDT 2024



-----Original Message-----
From: Sascha Hauer <s.hauer at pengutronix.de> 
Sent: Friday, September 20, 2024 5:32 PM
To: Pankaj Gupta <pankaj.gupta at nxp.com>
Cc: Jonathan Corbet <corbet at lwn.net>; Rob Herring <robh at kernel.org>;
Krzysztof Kozlowski <krzk+dt at kernel.org>; Conor Dooley
<conor+dt at kernel.org>; Shawn Guo <shawnguo at kernel.org>; Pengutronix Kernel
Team <kernel at pengutronix.de>; Fabio Estevam <festevam at gmail.com>; Rob
Herring <robh+dt at kernel.org>; linux-doc at vger.kernel.org;
linux-kernel at vger.kernel.org; devicetree at vger.kernel.org;
imx at lists.linux.dev; linux-arm-kernel at lists.infradead.org
Subject: Re: [EXT] Re: [PATCH v7 4/5] firmware: imx: add driver for NXP
EdgeLock Enclave

Caution: This is an external email. Please take care when clicking links or
opening attachments. When in doubt, report the message using the 'Report
this email' button


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.

Cannot compile as part of Firmware.
There are OTA scenarios where the latest FW, that is downloaded to replace
the image in RFS, and FW needs to be re-init with this new image, by putting
the Linux to power-down state.

ELE driver is compiled as module only, by default. But if someone like to
make it as in-line to kernel image, still it should work.

>Sascha

--
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       |
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pengutr
onix.de%2F&data=05%7C02%7Cpankaj.gupta%40nxp.com%7C136e82e202f34606acfa08dcd
96c1790%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638624305558398562%7CUn
known%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJX
VCI6Mn0%3D%7C0%7C%7C%7C&sdata=zx%2FjUGWs2qNnz4clLydY5%2BWNDVZoQ2AdP4ML5BeTjq
Q%3D&reserved=0  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 11094 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240925/db793985/attachment.p7s>


More information about the linux-arm-kernel mailing list