From: sashiko-bot@kernel.org
To: pankaj.gupta@oss.nxp.com
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org,
Frank.Li@kernel.org, robh@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v46 3/7] firmware: imx: add driver for NXP EdgeLock Enclave
Date: Wed, 02 Sep 2026 16:28:00 +0000 [thread overview]
Message-ID: <20260902162801.60BCF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260903-imx-se-if-v46-3-aefaab525034@nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Deadlock in suspend/resume path due to GFP_KERNEL memory allocations in ele_get_info().
--
commit 05cadf4c7e4a0295c86129fe662754b87efdff7e
Author: Pankaj Gupta <pankaj.gupta@nxp.com>
firmware: imx: add driver for NXP EdgeLock Enclave
Add MU-based communication interface for secure enclave. NXP hardware IP(s)
for secure-enclaves like Edgelock Enclave (ELE) are embedded in the SoC to
support features like HSM, SHE & V2X. The secure enclave FW communicates
with Linux over single or multiple dedicated messaging unit (MU) based
interface(s).
Closes: https://sashiko.dev/#/patchset/20260902-imx-se-if-v45-0-6e400879d8ec@nxp.com?part=3
> diff --git a/drivers/firmware/imx/ele_base_msg.c b/drivers/firmware/imx/ele_base_msg.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/firmware/imx/ele_base_msg.c
[ ... ]
> +int ele_get_info(struct se_if_priv *priv, struct ele_dev_info *s_info)
> +{
> + dma_addr_t get_info_addr = 0;
> + void *get_info_data = NULL;
> + u32 get_info_len;
> + int ret;
> +
> + if (!priv)
> + return -EINVAL;
> +
> + memset(s_info, 0x0, sizeof(*s_info));
> +
> + struct se_api_msg *tx_msg __free(kfree) =
> + kzalloc(ELE_GET_INFO_REQ_MSG_SZ, GFP_KERNEL);
> + if (!tx_msg)
> + return -ENOMEM;
> +
> + struct se_api_msg *rx_msg __free(kfree) =
> + kzalloc(ELE_GET_INFO_RSP_MSG_SZ, GFP_KERNEL);
> + if (!rx_msg)
> + return -ENOMEM;
> +
> + get_info_len = ELE_GET_INFO_BUFF_SZ;
> + if (priv->mem_pool)
> + get_info_data = gen_pool_dma_alloc(priv->mem_pool,
> + get_info_len,
> + &get_info_addr);
> + else
> + get_info_data = dma_alloc_coherent(priv->dev,
> + get_info_len,
> + &get_info_addr,
> + GFP_KERNEL);
[Severity: High]
Can these GFP_KERNEL allocations cause a system deadlock during suspend?
The commit message notes that ele_service_swap() was updated to use GFP_NOIO
because it runs in the suspend/resume path, and direct memory reclaim could
trigger I/O to a suspended storage device.
However, it appears ele_get_info() is also executed synchronously in this
exact same suspend/resume path:
> diff --git a/drivers/firmware/imx/ele_common.c b/drivers/firmware/imx/ele_common.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/firmware/imx/ele_common.c
[ ... ]
> +int se_save_imem_state(struct se_if_priv *priv, struct se_imem_buf *imem)
> +{
> + struct ele_dev_info s_info = {0};
> + int ret;
> +
> + ret = ele_get_info(priv, &s_info);
> + if (ret) {
> + dev_err(priv->dev, "Failed to get info from ELE.\n");
> + return ret;
> + }
Since se_suspend() unconditionally calls se_save_imem_state(), which in turn
calls ele_get_info(), won't the GFP_KERNEL allocations for tx_msg, rx_msg,
and get_info_data bypass the fix you made in ele_service_swap() and still
risk the same I/O reclaim deadlock?
Should these allocations in ele_get_info() also be changed to use GFP_NOIO
to ensure the entire suspend/resume chain avoids I/O triggers?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260903-imx-se-if-v46-0-aefaab525034@nxp.com?part=3
next prev parent reply other threads:[~2026-09-02 16:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 21:46 [PATCH v46 0/7] firmware: imx: driver for NXP secure-enclave pankaj.gupta
2026-09-02 21:46 ` [PATCH v46 1/7] Documentation/firmware: add imx/se to other_interfaces pankaj.gupta
2026-09-02 21:46 ` [PATCH v46 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc pankaj.gupta
2026-09-02 21:46 ` [PATCH v46 3/7] firmware: imx: add driver for NXP EdgeLock Enclave pankaj.gupta
2026-09-02 16:28 ` sashiko-bot [this message]
2026-09-02 21:46 ` [PATCH v46 4/7] firmware: imx: device context dedicated to priv pankaj.gupta
2026-09-02 21:46 ` [PATCH v46 5/7] firmware: imx: adds miscdev pankaj.gupta
2026-09-02 16:35 ` sashiko-bot
2026-09-02 21:05 ` Frank Li
2026-09-03 11:50 ` Pankaj Gupta (OSS)
2026-09-03 19:49 ` Frank Li
2026-09-02 21:46 ` [PATCH v46 6/7] arm64: dts: imx8ulp: add secure enclave node pankaj.gupta
2026-09-02 16:29 ` sashiko-bot
2026-09-02 21:46 ` [PATCH v46 7/7] arm64: dts: imx8ulp: add reserved memory for EdgeLock Enclave pankaj.gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260902162801.60BCF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=pankaj.gupta@oss.nxp.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.