linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Jon Povey <Jon.Povey@racelogic.co.uk>
Cc: J Barlow <jbarlow@ivl.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: RE: What if the UBI flasher can't skip all-FF pages?
Date: Tue, 18 Jan 2011 10:56:34 +0200	[thread overview]
Message-ID: <1295340994.2470.80.camel@koala> (raw)
In-Reply-To: <70E876B0EA86DD4BAF101844BC814DFE093F9302E3@Cloud.RL.local>

On Fri, 2011-01-14 at 05:45 +0000, Jon Povey wrote:
> > A long initial boot is not really a problem.  I was seriously
> > considering this, but I realized that I could set up a platform
> > specific workaround.  My bootloader can write UBIFS correctly, so
> all
> > I need to do is reprogram every PEB in the UBI volume on the first
> > boot before attempting to
> > load Linux.
> 
> If that is a fresh mkfs.ubifs filesystem not many blocks will have a
> mix of all-FF and not-all-FF pages, you only need to rewrite those
> blocks.
> all-FF blocks I think you can just erase completely and UBI will put
> headers back on later (someone else may like to comment..)

Right.

> Bear in mind what happens if you lose power or get reset while doing
> this process. If you are planning to do it in the factory with a test
> after, shouldn't be a problem.

We have UBI atomic leb change function for this - it should take care of
power cuts. But it has some overhead - it calculates CRC32 of the data.

So basically, my idea was:

1. Add a bit to the EC header which tells: this PEB needs re-freshing.
2. After scanning and initializing, do 'ubi_eba_atomic_leb_change()' for
all LEBs which are mapped to PEBs with that flag.
3. 'ubi_eba_atomic_leb_change()' will atomically move the data to
another PEB and clean the flag.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)

  reply	other threads:[~2011-01-18  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 22:47 What if the UBI flasher can't skip all-FF pages? J Barlow
2011-01-11  9:35 ` Artem Bityutskiy
2011-01-13 22:23   ` J Barlow
2011-01-14  5:45     ` Jon Povey
2011-01-18  8:56       ` Artem Bityutskiy [this message]
2011-01-18  8:56 ` Artem Bityutskiy

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=1295340994.2470.80.camel@koala \
    --to=dedekind1@gmail.com \
    --cc=Jon.Povey@racelogic.co.uk \
    --cc=jbarlow@ivl.com \
    --cc=linux-mtd@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).