Re: [PATCH 10/10] remoteproc: imx_dsp_rproc: Fix off-by-one bitmask for trailing bytes
From: Peng Fan (OSS)
Date: Mon Nov 23 2026 - 22:29:43 EST
On Mon, 23 Nov 2026 17:20:54 +0000 Lee Jones <lee@xxxxxxxxxx> wrote:
> When size is not a multiple of 4, both imx_dsp_rproc_memcpy() and
> imx_dsp_rproc_memset() compute affected_mask as GENMASK(8 * r, 0) for
> the remaining r bytes (1 <= r <= 3). Because GENMASK(h, l) is inclusive
> of bit h, GENMASK(8 * r, 0) sets 8 * r + 1 bits and clears or overwrites
> the least-significant bit of the first byte past the end of the target
> region during the 32-bit read-modify-write.
>
> Use GENMASK(8 * r - 1, 0) to mask exclusively the r trailing bytes.
>
> Fixes: 408ec1ff0caa ("remoteproc: imx_dsp_rproc: Add custom memory copy implementation for i.MX DSP Cores")
> Closes: https://sashiko.dev/#/bug/linux-2e407b68-a7e9-42ff-a613-e61b47a4461b
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
Reviewed-by: Peng Fan <peng.fan@xxxxxxx>