Re: [RFC PATCH 1/2] mtd: core: protect access to mtd devices while in suspend

From: Boris Brezillon
Date: Fri Oct 08 2021 - 12:08:18 EST


On Fri, 8 Oct 2021 17:35:26 +0200
Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:

> > into suspend. But it's actually "mtd: rawnand: Simplify the locking" that
> > allows it to return errors rather than locking, before that commit it would
> > have waited for the rawnand device to resume.
>
> I don't think so, I believe it was broken in the same way but was just
> not returning errors.

Actually I was wrong, 013e6292aaf5 ("mtd: rawnand: Simplify the
locking") removed the blocking wait (returning -EBUSY when the device
is suspended instead of putting the thread on a waitqueue). At that
time, I assumed all threads would be paused when the device is
suspended, which appeared to be incorrect. So I guess the Fixes tag
should remain, and we might want to consider backporting a less
invasive patch to stable releases (one touching only the raw NAND
layer).