mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] rc-once: make sure data makes it to the medium
Date: Tue, 11 Aug 2020 12:24:39 +0200	[thread overview]
Message-ID: <20200811102439.GA2714844@lenoch> (raw)
In-Reply-To: <CAH+2xPBVz0CDpJQxxT3XeDr=BN6GduQJ7VndrF+6rH2=nZyopQ@mail.gmail.com>

On Mon, Aug 10, 2020 at 06:03:03PM +0200, Bruno Thomsen wrote:
> Den man. 10. aug. 2020 kl. 15.59 skrev Robert Schwebel
> <r.schwebel@pengutronix.de>:
> >
> > 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
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

  reply	other threads:[~2020-08-11 10:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10 10:17 Robert Schwebel
2020-08-10 13:46 ` Uwe Kleine-König
2020-08-10 13:59   ` Robert Schwebel
2020-08-10 16:03     ` Bruno Thomsen
2020-08-11 10:24       ` Ladislav Michl [this message]
2020-08-17  6:18 ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200811102439.GA2714844@lenoch \
    --to=ladis@linux-mips.org \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox