All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] PATCH: bugfix for nand erase failure with bad blocks
Date: Wed, 17 Jun 2009 11:18:09 +0200	[thread overview]
Message-ID: <20090617091809.E594E832E416@gemini.denx.de> (raw)
In-Reply-To: <4A37FE47.3030203@freescale.com>

Dear Scott,

In message <4A37FE47.3030203@freescale.com> you wrote:
>
> > I see - thanks for the explanation.
> > 
> > Hm... actually I think the write should fail in such a case...
> > 
> > Scott, what do you think?
> 
> I think the current behavior is reasonable.  You're erasing a specific 
> region of flash, not an amount needed to hold a certain amount of data.
> 
> While I can see the appeal of Michele's suggestion, I think it would be 
> more error-prone as people trying to erase a region rather than just the 
> size of data could erase too much.

That was my initial thought, too, which is why I asked Michele for an
explanation.

when I think about typiical use cases like automatic uypdate script
similar to:

	=> tftp 200000 filename
	=> nand erase 0 +${filesize}
	=> nand write 200000 0 ${filesize}

I (and probably any other user) will  expect  that  the  "erase"  and
"nand  write"  commands  use  the  same  interpretation  for the size
argument, i. e. that and "erase" followed by a "write" will have made
sufficient room to write all data.

Thus I reconsidered and think the patch is actually reasonable, as it
does what is the most practical use case needs.

> It definitely should not be an error to erase a region that happens to 
> contain a bad block.  Bad blocks are expected and we need to work around 
> them.

Agreed.

But it should be an error when writing to not erase flash blocks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"...this does not mean that some of us should not want, in  a  rather
dispassionate sort of way, to put a bullet through csh's head."
                   - Larry Wall in <1992Aug6.221512.5963@netlabs.com>

      parent reply	other threads:[~2009-06-17  9:18 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
2009-06-19  7:01                       ` Michele De Candia
2009-06-17 22:11               ` Wolfgang Denk
2009-06-17  9:18         ` Wolfgang Denk [this message]

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=20090617091809.E594E832E416@gemini.denx.de \
    --to=wd@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.