Re: [PATCH v2] mtd: spi-nor: scope the exclusive RWW lock

From: Miquel Raynal

Date: Tue Aug 11 2026 - 03:52:19 EST


On 11/08/2026 at 12:13:49 +08, Runyu Xiao <runyu.xiao@xxxxxxxxxx> 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