Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhiqiang Hou" <Zhiqiang.Hou@nxp.com>
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCHv3] remoteproc: imx_rproc: add missing DRAM ranges for i.MX93
Date: Mon, 25 May 2026 06:36:30 +0000	[thread overview]
Message-ID: <20260525063630.E34E51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260525062031.24725-1-Zhiqiang.Hou@nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Address translation fails for requests matching exactly the end boundary of a memory region due to a strict inequality check.
--

commit 32acb41558a7e1f55f57c27cddcfe528e4522a38
Author: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

remoteproc: imx_rproc: add missing DRAM ranges for i.MX93

This commit adds missing M33 DRAM address mappings (secure and non-secure
ranges) to the i.MX93 remoteproc address translation table. These additions
complete the DRAM coverage and prevent invalid address translations for
firmware accessing these regions.

> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index 7f54322244aca..175c2d3099794 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -198,6 +198,9 @@ static const struct imx_rproc_att imx_rproc_att_imx93[] = {
>  	{ 0x80000000, 0x80000000, 0x10000000, 0 },
>  	{ 0x90000000, 0x80000000, 0x10000000, 0 },
>  
> +	{ 0xA0000000, 0xA0000000, 0x10000000, 0 },
> +	{ 0xB0000000, 0xA0000000, 0x10000000, 0 },
> +

[Severity: High]
This is a pre-existing issue, but I noticed the boundaries of these translation
regions are checked using a strict inequality in imx_rproc_da_to_sys() and
imx_rproc_da_to_va().

In imx_rproc_da_to_sys(), the translation request is checked like this:

drivers/remoteproc/imx_rproc.c:imx_rproc_da_to_sys() {
	...
	if (da >= att->da && da + len < att->da + att->size) {
		unsigned int offset = da - att->da;
	...
}

And similarly in imx_rproc_da_to_va():

drivers/remoteproc/imx_rproc.c:imx_rproc_da_to_va() {
	...
	if (sys >= priv->mem[i].sys_addr && sys + len <
	    priv->mem[i].sys_addr +  priv->mem[i].size) {
		unsigned int offset = sys - priv->mem[i].sys_addr;
	...
}

Does this mean that if a translation request extends exactly to the end of a
memory region (da + len == att->da + att->size), it will be incorrectly
rejected?

Could this cause firmware loading or communication to fail if a resource
table, memory segment, or vring is placed exactly at the end of a memory
region?

>  	{ 0xC0000000, 0xC0000000, 0x10000000, 0 },
>  	{ 0xD0000000, 0xC0000000, 0x10000000, 0 },
>  };

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260525062031.24725-1-Zhiqiang.Hou@nxp.com?part=1

  reply	other threads:[~2026-05-25  6:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  6:20 [PATCHv3] remoteproc: imx_rproc: add missing DRAM ranges for i.MX93 Zhiqiang Hou
2026-05-25  6:36 ` sashiko-bot [this message]
2026-05-25 12:23 ` Peng Fan
2026-05-25 14:52 ` Mathieu Poirier
2026-05-26  3:32   ` Peng Fan

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=20260525063630.E34E51F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=imx@lists.linux.dev \
    --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