[PATCH 0/2] Support skipping bad blocks when seeking to start address

Mike Crowe mac at mcrowe.com
Thu Jan 5 07:04:02 PST 2017


On Thursday 05 January 2017 at 15:48:24 +0100, Boris Brezillon wrote:
> On Thu, 5 Jan 2017 14:18:34 +0000
> Mike Crowe <mac at mcrowe.com> wrote:
> > On Thursday 05 January 2017 at 14:38:23 +0100, goliath wrote:
> > > If your boot loader seeks to a specific erase block by counting
> > > only good blocks (to load the kernel or some second stage?), what
> > > happens if another block in between goes bad? Does that just brick
> > > your board or do you have to move the data around all the time to
> > > account for that?  
> > 
> > The blocks in-between don't get written so they can't be marked bad.
> 
> Maybe not the block in between, but the first block used to store your
> 2nd stage bootloader (or whatever your store at this offset) might
> become bad, which means your data will be moved to the next block (or
> possibly farther).

In our case we always write the remainder of the partition so any bad
blocks that develop will shift everything else down too. You're correct
that this would be a problem if we attempted to write in the middle though.

> I think this request is acceptable (even if I don't like the option
> name :-)), but I'll let Richard and David decide what to do with this
> patch.

I'm not particularly attached to the option name. I chose
"--skip-bad-blocks-to-start" in the hope of being as clear as possible, but
I agree that it is a mouthful! The confusion over the meaning of the option
was also one of the reasons why I originally implemented the feature using
a separate offset.

Thanks for the review.

Mike.



More information about the linux-mtd mailing list