Re: [PATCH] mtd: map_ram: prevent use of point and unpoint when NO_XIP is set

From: Miquel Raynal
Date: Fri Sep 22 2023 - 10:51:28 EST


On Tue, 2023-09-19 at 11:33:20 UTC, Shivamurthy Shastri wrote:
> When the DT property no-unaligned-direct-access is set, map->phys is set
> to NO_XIP. With this property set, the flash should not be exposed
> directly to MTD users, since it cannot be mapped.
>
> map_ram() exposes the flash direct access unconditionally which leads to
> access errors (when the bus width does not match the RAM width).
>
> Therefore do not set point and unpoint when NO_XIP is set.
>
> Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@xxxxxxxxxxxxx>
> Reviewed-by: Benedikt Spranger <b.spranger@xxxxxxxxxxxxx>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel