[PATCH 09/10] remoteproc: imx_dsp_rproc: Fix pointer stride in imx_dsp_rproc_memset()
From: Lee Jones
Date: Mon Nov 23 2026 - 12:23:07 EST
Commit 3c497f624d40 ("remoteproc: imx_dsp_rproc: Fix kernel test robot
sparse warning") changed tmp_dst from u32 * to void __iomem *. In GNU
C, incrementing a void pointer advances it by 1 byte rather than 4
bytes. Consequently, the word-fill loop in imx_dsp_rproc_memset()
steps by 1 byte per 32-bit writel(), triggering unaligned 32-bit MMIO
accesses on Device-mapped DSP IRAM, mispositioning tmp_dst for the
trailing-byte read-modify-write, and leaving roughly three quarters of
the target region uninitialised.
Advance tmp_dst by 4 bytes per 32-bit word write.
Fixes: 3c497f624d40 ("remoteproc: imx_dsp_rproc: Fix kernel test robot sparse warning")
Closes: https://sashiko.dev/#/bug/linux-720f943f-eefd-4df7-806e-0b50cad1abbe
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/remoteproc/imx_dsp_rproc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index 96d619daf3f5..2771043ee433 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -843,8 +843,10 @@ static int imx_dsp_rproc_memset(void *addr, u8 value, size_t size)
q = size / 4;
r = size % 4;
- while (q--)
- writel(tmp_val, tmp_dst++);
+ while (q--) {
+ writel(tmp_val, tmp_dst);
+ tmp_dst += 4;
+ }
if (r) {
affected_mask = GENMASK(8 * r, 0);
--
2.56.1.750.gf70dc682cf-goog