Re: [PATCH v7 07/11] firmware: imx: add driver for NXP EdgeLock Enclave

From: Krzysztof Kozlowski
Date: Mon Oct 30 2023 - 14:02:58 EST


On 30/10/2023 10:58, Pankaj Gupta wrote:
> The Edgelock Enclave , is the secure enclave embedded in the SoC
> to support the features like HSM, SHE & V2X, using message based
> communication channel.
>
> ELE FW communicates on a dedicated MU with application core where
> kernel is running. It exists on specific i.MX processors. e.g.
> i.MX8ULP, i.MX93.
>
> 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

OK, I got your patch #7. Thanks for documenting the user-space.

>
> Signed-off-by: Pankaj Gupta <pankaj.gupta@xxxxxxx>

...

> diff --git a/drivers/firmware/imx/ele_common.c b/drivers/firmware/imx/ele_common.c
> new file mode 100644
> index 000000000000..4410245a19ec
> --- /dev/null
> +++ b/drivers/firmware/imx/ele_common.c
> @@ -0,0 +1,139 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2023 NXP
> + */
> +
> +#include "ele_common.h"
> +#include "se_fw.h"
> +
> +int imx_se_alloc_tx_rx_buf(struct ele_mu_priv *priv)
> +{
> + int ret = 0;
> +
> + priv->tx_msg = devm_kzalloc(priv->dev,
> + sizeof(*priv->tx_msg),
> + GFP_KERNEL);
> + if (!priv->tx_msg) {
> + ret = -ENOMEM;
> + dev_err(priv->dev, "Fail allocate mem for tx_msg.\n");

No improvements. I assume rest of feedback could still be ignored. I am
not going to check. It's your duty to implement the comments, not mine
to check every line whether you did it or not. Trust does not work like
that.

Best regards,
Krzysztof