Re: [PATCH v4 1/2] mtd: spi-nor: core: Fix mutex leak in spi_nor_rww_start_exclusive()

Miquel Raynal <[email protected]>
Newsgroups org.kernel.vger.stable,org.infradead.lists.linux-mtd,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 19/08/2026 at 22:03:36 +08, Runyu Xiao <[email protected]> wrote:

> The RWW wait helpers must not block while evaluating the condition.
> spi_nor_rww_start_exclusive() used mutex_lock() directly and could return
> with nor->lock still held.
>
> Switch the four RWW start helpers to conditional scoped mutex guards so
> the wait condition never sleeps and nor->lock is released before
> return.

What? Why?

Please.

Previous patch was right, why are you converting to scope guard?

You did not pick the Reviewed-by tags.
>
> Fixes: 74df43b3f626 ("mtd: spi-nor: Enhance locking to support reads
> while writes")

This Fixes is wrong, the original one was right, please check the entire
conversation.

> Cc: [email protected]
> Signed-off-by: Runyu Xiao <[email protected]>
>
> Changes in v4:

Changelog should not be here but below the ---.

You miss changes from v2 and v3.

> - Use the original RWW locking commit in Fixes and update the subject.
> - Apply the locking fix to all RWW start helpers used as wait conditions.
> - Keep commit 03e7bb864d9a ("mtd: spi-nor: use scope-based mutex
>   cleanup helpers") as a stable prerequisite because it adds
> cleanup.h.

Where did you do that?

If you want to fix the remaining Sashiko issue (the sleep issue) you
can, but please do it in another patch.

Thanks,
Miquèl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.