[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<AM9PR04MB860463DED50B8371D349E3F095ABA@AM9PR04MB8604.eurprd04.prod.outlook.com>
Date: Wed, 17 Dec 2025 08:40:03 +0000
From: Pankaj Gupta <pankaj.gupta@....com>
To: Frank Li <frank.li@....com>
CC: Jonathan Corbet <corbet@....net>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Shawn Guo
<shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>, Pengutronix
Kernel Team <kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"imx@...ts.linux.dev" <imx@...ts.linux.dev>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH v21 5/7] firmware: drivers: imx: adds miscdev
> > Adds the driver for communication interface to secure-enclave, that
> > enables exchanging messages with NXP secure enclave HW IP(s) like
> > EdgeLock Enclave, from:
> > - User-Space Applications via character driver.
> >
> > ABI documentation for the NXP secure-enclave driver.
> >
> > User-space library using this driver:
> > - i.MX Secure Enclave library:
> > -- URL: https://github.com/nxp-imx/imx-secure-enclave.git,
> > - i.MX Secure Middle-Ware:
> > -- URL: https://github.com/nxp-imx/imx-smw.git
> >
> > Following checks are performed on the incoming msg-header, to block
> > exchanging invalid arbitrary commands:
> > - maximum allowed words,
> > - check if command-tag & response-tag are valid
> > - version,
> > - command id validation check, to allow limited base-line API(s)
> > and restrict following:
> > - exchanging power management commands.
> > - reset requests.
> > - BBSM configuration requests.
> > - re-initializing the FW.
> > - RNG init
> > - CAAM resource release management
> > - SE's internal memory management.
> > from user-space.
> >
> > Signed-off-by: Pankaj Gupta <pankaj.gupta@....com>
> > Reviewed-by: Frank Li <Frank.Li@....com>
> > ---
> > changes from v20 to v21
> > - removed "__free(kfree)" & added kfree();
>
> KK's means is that correctly use __free according to cleanup.h.
>
> fun()
> {
> ...
> some code logic
> ...
>
> struct .... __free(kfree) rx_msg =
> kzalloc(cmd_snd_rcv_rsp_info.rx_buf_sz, GFP_KERNEL);
> ...
> }
>
> Frank
Hi Krzysztof, Hi Frank,
Thank you for the review comments.
I misunderstood earlier and removed __free(kfree) in v21, thinking it was not preferred.
After revisiting your feedback, I see the intent is to use __free(kfree) correctly as per cleanup.h guidelines for automatic cleanup instead of manual kfree() calls.
I will revert the previous change and update the patch to follow the recommended pattern:
- strucivt se_api_msg *tx_msg __free(kfree) = kzalloc (XXXXX, GFP_KERNEL);
- Make sure the source files has: #include <linux/cleanup.h>
This will be included in v22 along with a clear comment disposition referencing your suggestion.
Thanks for clarifying and for your guidance.
Best regards,
Pankaj Gupta
Powered by blists - more mailing lists