Re: [PATCH v5] mtd: spi-nor: take the flash lock around spi_nor_restore()
From: Itai Handler
Date: Wed Nov 18 2026 - 12:17:53 EST
On Wed Nov 18, 2026 at 3:23 PM CET, Miquel Raynal wrote:
>>> + ret = spi_nor_prep_and_lock(nor);
>>> + if (ret == -ESHUTDOWN)
>>
>> This is actually really hard to follow.
>
> Yes, I tried to review this patch and eventually stopped. Please teach
> your AI to not overengineer its solutions.
Sorry for the time it cost you. That one is on me: I sent it, and I
should have made it simpler before sending it.
v6 is simpler. It follows Michael's sketch: spi_nor_restore() takes
the lock itself and then sets a "restored" flag, and the lock helpers
fail any later operation with -EIO. The extra helper and the special
error code are gone, and the commit message is about half as long.
The diff is longer than v5's only because the _pe and _rd unlock
helpers move up, as Michael asked.
Thanks,
Itai