public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] PATCH: bugfix for nand erase failure with bad blocks
Date: Wed, 17 Jun 2009 17:34:11 -0500	[thread overview]
Message-ID: <4A396F63.8030500@freescale.com> (raw)
In-Reply-To: <20090617221506.759C7832E416@gemini.denx.de>

Wolfgang Denk wrote:
> Dear Scott,
> 
> In message <4A39685F.6030304@freescale.com> you wrote:
>> Hmm... perhaps check the alignment?  If "end" is supposed to be the last 
>> to-be-erased byte, not the first not-to-be-erased byte, then if the low 
>> bits are 0 it's a size (and gets a warning) and if they're 1 it's an end?
> 
> Stop here. Don't add fancy stuf that nobody expects.

Nobody expects the semantics to silently change...

I'm not particularly advocating this approach, just throwing out 
alternatives.  Leaving it alone is probably best.

> Ask yourself what the end user expects - we all think of "erase"
> preparing the grounds for "write", right?

Sometimes.  Other times, it could be preparing for use by a filesystem 
(which may not use the same bad block handling scheme), to reset the 
environment, for testing, etc.

We have the plus syntax specifically for the use case of erase+write of 
a specific number of bytes; IMO that's the place for this kind of 
interpretation.

> So both should work oin the
> same NAND flash region when given the same arguments (offset and seze,

So then there would be no reliable way of erasing a specific range of 
flash.  To properly use the block-skipping approach, the user needs to 
have in mind a range of actual blocks that the data can take up (i.e. a 
maximum number of bad blocks to expect), so that they can avoid locating 
the next partition within that range.  I don't think it makes sense to 
try to completely hide this.

Perhaps "write" should accept an optional limit argument, returning an 
error if enough bad blocks were encountered to bust the limit.

 > no matter how these are specified).

If the syntax were changed to start/end, but the erase could go beyond 
end anyway, that would be extremely confusing.

-Scott

  reply	other threads:[~2009-06-17 22:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 13:06 [U-Boot] PATCH: bugfix for nand erase failure with bad blocks Michele De Candia
2009-06-16 18:10 ` Wolfgang Denk
2009-06-16 19:51   ` Michele De Candia
2009-06-16 20:09     ` Wolfgang Denk
2009-06-16 20:19       ` Scott Wood
2009-06-17  7:18         ` Michele De Candia
2009-06-17  7:43           ` Michele De Candia
2009-06-17  7:44           ` Michele De Candia
2009-06-17 15:54             ` Scott Wood
2009-06-17 16:17               ` Michele De Candia
2009-06-17 22:04                 ` Scott Wood
2009-06-17 22:15                   ` Wolfgang Denk
2009-06-17 22:34                     ` Scott Wood [this message]
2009-06-19  7:01                       ` Michele De Candia
2009-06-17 22:11               ` Wolfgang Denk
2009-06-17  9:18         ` Wolfgang Denk

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=4A396F63.8030500@freescale.com \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.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