On Mon, Aug 10, 2020 at 06:03:03PM +0200, Bruno Thomsen wrote:
> Den man. 10. aug. 2020 kl. 15.59 skrev Robert Schwebel
> <[email protected]>:
> >
> > On Mon, Aug 10, 2020 at 03:46:15PM +0200, Uwe Kleine-König wrote:
> > > >  umount() {
> > > > +   # make sure rc-once generated data makes it to the medium
> > > > +   sync
> > > >     if ! mount_root_restore; then
> > > >             # remounting rw/ro during the second boot will flush 
> > > > anything
> > > >             # left in the filesystem journal
> > >
> > > I would expect that the mount -o remount,ro that is done (sometimes) as
> > > part of mount_root_restore should handle this just fine.
> >
> > In my case the system is always booted rw, so remounting ro doesn't
> > happen here at all, the script exits and the labgrid server powers the
> > board off before the data is written to disk.
> >
> > Most other systems mount / ro, so remounting happens here and acts as a
> > flush barrier.
> 
> We do something similar, "sync; sleep 3; umount", as it seems that emmc caches
> writes internally in RAM so data is lost if power is removed too fast.

Hmm, mmc_shutdown() calls the cache flush, so either something went wrong
and mmc_shutdown() was not called before power off driver did its job or...

> In an ideal world
> both sync and umount should block until all data has been written.

...your not ideal world just powers your board (instead asking it to do so).
In the latter case just use mmc-utils to flush the cache.

> Bruno

        ladis

_______________________________________________
ptxdist mailing list
[email protected]
To unsubscribe, send a mail with subject "unsubscribe" to 
[email protected]

Reply via email to