[PATCH v2] mtd: spi-nor: scope the exclusive RWW lock
Miquel Raynal
miquel.raynal at bootlin.com
Tue Aug 11 00:51:52 PDT 2026
On 11/08/2026 at 12:13:49 +08, Runyu Xiao <runyu.xiao at seu.edu.cn> wrote:
> spi_nor_rww_start_exclusive() is used as the wait_event_killable()
> condition for RWW access. When RWW is busy, it can return false while
> still holding nor->lock, which blocks spi_nor_rww_end_exclusive() from
> clearing the RWW state.
>
> Use guard(mutex) here so nor->lock is released before the condition
> returns, while the state flags still hand off ownership to the caller.
> This keeps the mutex scope aligned with the other RWW start helpers.
The diff is now correct, but the commit log is still missing the
point. There has been a translation from raw mutexes into scoped
helpers, this translation missed one spot. This should be the core of
your commit log.
Miquèl
More information about the linux-mtd
mailing list