Re: [PATCH] mtd: rawnand: serialize lock/unlock against other NAND operations
From: Miquel Raynal
Date: Wed Mar 11 2026 - 11:35:30 EST
On Thu, 05 Mar 2026 14:49:06 -0500, Kamal Dasu wrote:
> nand_lock() and nand_unlock() call into chip->ops.lock_area/unlock_area
> without holding the NAND device lock. On controllers that implement
> SET_FEATURES via multiple low-level PIO commands, these can race with
> concurrent UBI/UBIFS background erase/write operations that hold the
> device lock, resulting in cmd_pending conflicts on the NAND controller.
>
> Add nand_get_device()/nand_release_device() around the lock/unlock
> operations to serialize them against all other NAND controller access.
>
> [...]
Applied to mtd/fixes, thanks!
[1/1] mtd: rawnand: serialize lock/unlock against other NAND operations
commit: bab2bc6e850a697a23b9e5f0e21bb8c187615e95
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl