From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from eddie.linux-mips.org ([148.251.95.138] helo=cvs.linux-mips.org) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1k5RSW-0003sx-O6 for ptxdist@pengutronix.de; Tue, 11 Aug 2020 12:24:45 +0200 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23993097AbgHKKYmPEaSn (ORCPT ); Tue, 11 Aug 2020 12:24:42 +0200 Date: Tue, 11 Aug 2020 12:24:39 +0200 From: Ladislav Michl Message-ID: <20200811102439.GA2714844@lenoch> References: <20200810101713.247725-1-r.schwebel@pengutronix.de> <20200810134615.sipkuohxucftbcy2@pengutronix.de> <20200810135900.aklcw4an55tytzy7@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Subject: Re: [ptxdist] [PATCH] rc-once: make sure data makes it to the medium List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Mon, Aug 10, 2020 at 06:03:03PM +0200, Bruno Thomsen wrote: > Den man. 10. aug. 2020 kl. 15.59 skrev Robert Schwebel > : > > > > On Mon, Aug 10, 2020 at 03:46:15PM +0200, Uwe Kleine-K=F6nig 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 an= ything > > > > # 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 c= aches > 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@p= engutronix.de