Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: pankaj.gupta@oss.nxp.com
Cc: devicetree@vger.kernel.org, Frank.Li@kernel.org,
	imx@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v49 3/7] firmware: imx: add driver for NXP EdgeLock Enclave
Date: Tue, 08 Sep 2026 12:03:00 +0000	[thread overview]
Message-ID: <20260908120301.4DAF41F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260908-imx-se-if-v49-3-a59529118839@nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unchecked return value of dma_set_mask_and_coherent() can break system suspend and cause silent truncation.
--

commit 11689bad8661c5539198f994ba798438370f3e15
Author: Pankaj Gupta <pankaj.gupta@nxp.com>
Subject: firmware: imx: add driver for NXP EdgeLock Enclave

This commit introduces the driver for the NXP EdgeLock Enclave (ELE). It adds
a messaging-unit based communication interface for secure enclaves on i.MX SoC
platforms, managing firmware authentication, loading, and suspend/resume
states.

> diff --git a/drivers/firmware/imx/se_ctrl.c b/drivers/firmware/imx/se_ctrl.c
> index 0000000000000..4b9354b0e24aa 100644
> --- /dev/null
> +++ b/drivers/firmware/imx/se_ctrl.c

[ ... ]

> @@ -396,6 +396,16 @@ static int se_if_probe(struct platform_device *pdev)
> +	if (if_node->reserved_dma_ranges) {
> +		ret = of_reserved_mem_device_init(dev);
> +		if (ret)
> +			return dev_err_probe(dev, ret,
> +					     "Failed to init reserved memory region.\n");
> +	}
> +
> +	dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));

[Severity: Medium]
Is it safe to ignore the return value of dma_set_mask_and_coherent() here?

If the platform cannot satisfy the 32-bit DMA mask requirement, this will
fail silently but the probe will succeed anyway. Later, if DMA allocations
(like imem.buf or firmware images) return physical addresses above 32 bits,
functions like ele_service_swap() or ele_fw_authenticate() will explicitly
reject them with -ERANGE or -EINVAL.

This could render the enclave non-functional and break system suspend.
Should we check the return value and fail the probe if the required DMA
mask isn't supported?

> +
> +	/*
> +	 * Initialize load_fw_lock before registering the misc device.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-imx-se-if-v49-0-a59529118839@nxp.com?part=3

  reply	other threads:[~2026-09-08 12:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 17:18 [PATCH v49 0/7] firmware: imx: driver for NXP secure-enclave pankaj.gupta
2026-09-08 17:18 ` [PATCH v49 1/7] Documentation/firmware: add imx/se to other_interfaces pankaj.gupta
2026-09-08 17:18 ` [PATCH v49 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc pankaj.gupta
2026-09-08 17:18 ` [PATCH v49 3/7] firmware: imx: add driver for NXP EdgeLock Enclave pankaj.gupta
2026-09-08 12:03   ` sashiko-bot [this message]
2026-09-08 17:18 ` [PATCH v49 4/7] firmware: imx: device context dedicated to priv pankaj.gupta
2026-09-08 17:18 ` [PATCH v49 5/7] firmware: imx: adds miscdev pankaj.gupta
2026-09-08 12:05   ` sashiko-bot
2026-09-08 17:18 ` [PATCH v49 6/7] arm64: dts: imx8ulp: add secure enclave node pankaj.gupta
2026-09-08 12:00   ` sashiko-bot
2026-09-08 17:18 ` [PATCH v49 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=20260908120301.4DAF41F00A3A@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox