[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PAXPR04MB8459F2126C8D692EC6F8065D8864A@PAXPR04MB8459.eurprd04.prod.outlook.com>
Date: Sun, 8 Feb 2026 11:45:11 +0000
From: Peng Fan <peng.fan@....com>
To: Dan Carpenter <dan.carpenter@...aro.org>
CC: Pengutronix Kernel Team <kernel@...gutronix.de>, Fabio Estevam
<festevam@...il.com>, "linux-remoteproc@...r.kernel.org"
<linux-remoteproc@...r.kernel.org>, "imx@...ts.linux.dev"
<imx@...ts.linux.dev>, "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, linux-kernel
<linux-kernel@...r.kernel.org>
Subject: RE: [bug report] remoteproc: imx_rproc: Introduce prepare ops for
imx_rproc_dcfg
Hi Dan,
Thanks for your report.
> Subject: [bug report] remoteproc: imx_rproc: Introduce prepare ops for
> imx_rproc_dcfg
>
> Hello Peng Fan,
>
> Commit edd2a9956055 ("remoteproc: imx_rproc: Introduce prepare
> ops for imx_rproc_dcfg") from Jan 9, 2026 (linux-next), leads to the
> following Smatch static checker warning:
>
> drivers/remoteproc/imx_rproc.c:648 imx_rproc_prepare()
> warn: ignoring unreachable code.
>
> drivers/remoteproc/imx_rproc.c
[...]
> 642 return -ENOMEM;
> 643
> 644 rproc_coredump_add_segment(rproc, da,
> resource_size(&res));
> 645 rproc_add_carveout(rproc, mem);
> 646 }
> 647
> --> 648 if (priv->ops && priv->ops->prepare)
> 649 return priv->ops->prepare(rproc);
>
> This is unreachable code.
Indeed.
The i.MX95 patches were developed quite some time ago. Later, there was
another change [1] which modified the reserved-memory while-loop logic.
When rebasing my changes on top of that, I overlooked this behavior
change, which resulted in the early return making the prepare callback
unreachable.
Regarding why this was not exposed earlier during testing: NXP U-Boot
powers up the M7 (leaving it in reset) and initializes TCM ECC by default.
As a result, even without calling the platform prepare ops, Linux can
still load the M7 ELF correctly, so no issue was observed.
In hindsight, I should have tested the case where M7 remains powered off
when rebasing these changes (:
I have just sent out a fix to address this issue. Thanks again for
reporting it.
[1] 67a7bc7f0358b ("remoteproc: Use of_reserved_mem_region_* functions for "memory-region")
Thanks,
Peng
> 650
> 651 return 0;
> 652 }
>
> regards,
> dan carpenter
Powered by blists - more mailing lists