Re: [PATCH] PM / suspend: move userspace freeze before disk sync

From: Miquel Raynal
Date: Fri Sep 03 2021 - 05:18:03 EST


Hi Sean,

sean@xxxxxxxxxx wrote on Fri, 3 Sep 2021 10:17:51 +0200:

> On Thu, Sep 02, 2021 at 06:28:14PM +0200, Rafael J. Wysocki wrote:
> > On Wed, Sep 1, 2021 at 10:35 AM Sean Nyekjaer <sean@xxxxxxxxxx> wrote:
> > >
> > > This fixes an issue where data remains unwritten before suspend.
> >
> > Well, it doesn't make the issue go away, it just hides it for you and
> > it may very well expose it for someone else.
>
> OK
>
> >
> > In particular, note that you can compile the kernel with
> > CONFIG_SUSPEND_SKIP_SYNC set which makes it not sync at all during
> > system-wide suspend and this is a valid case expected to work. It
> > looks like this case doesn't work for you.
> >
> > > UBI tried to write data, before the mtd device had been unsuspended.
> >
> > Well, that's the real problem and it can happen regardless of whether
> > or not this patch is there.
>
> How to fix it then?
> We can't live with devices that bricks on unsuspend :/

We then need to focus on UBI/UBIFS implementation (Richard is currently
off), maybe there is more logic than just a basic retry to implement.

Thanks,
Miquèl