public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Issue with h/w ecc based NAND driver.
@ 2006-08-23 18:12 Han Chang
  2006-08-30 16:37 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Han Chang @ 2006-08-23 18:12 UTC (permalink / raw)
  To: linux-mtd

Hi there,

I'm using a NAND with h/w ecc. When a block is erased, both main data and 
oob are set to 0xff, and if the driver read the main data in the page with 
hardware enabled ecc, the 0xff in the oob is not the right ecc code, so the 
ecc mechanism in the h/w try to recover the error and trash the content in 
the main data area.

I tried to set the right ecc code in the oob for every page whenever a block 
is erased. But then the problem is with page programming. When write a page, 
the h/w ecc controller generates the ecc code and write it to the oob, since 
the oob is already written once during erase, the 2nd write to the oob is 
not taken well. So when read back the same page, it causes ecc error again.

I would appreciate very much if someone can shed some light on this kind of 
delimma.

Thanks,
Han

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Issue with h/w ecc based NAND driver.
  2006-08-23 18:12 Issue with h/w ecc based NAND driver Han Chang
@ 2006-08-30 16:37 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2006-08-30 16:37 UTC (permalink / raw)
  To: Han Chang; +Cc: linux-mtd

On Wed, 2006-08-23 at 11:12 -0700, Han Chang wrote:
> Hi there,
> 
> I'm using a NAND with h/w ecc. When a block is erased, both main data and 
> oob are set to 0xff, and if the driver read the main data in the page with 
> hardware enabled ecc, the 0xff in the oob is not the right ecc code, so the 
> ecc mechanism in the h/w try to recover the error and trash the content in 
> the main data area.
> 
> I tried to set the right ecc code in the oob for every page whenever a block 
> is erased. But then the problem is with page programming. When write a page, 
> the h/w ecc controller generates the ecc code and write it to the oob, since 
> the oob is already written once during erase, the 2nd write to the oob is 
> not taken well. So when read back the same page, it causes ecc error again.
> 
> I would appreciate very much if someone can shed some light on this kind of 
> delimma.

That's a know problem with braindead hardware. One solution is to apply
cluesticks (i.e. baseball bats) on the hardware designer. This only
helps for your well-being and does not solve the problem itself.

Look into drivers/mtd/nand/diskonchip.c doc200x_correct_data(). There is
an approach to tackle exactly the same problem.

	tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-30 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-23 18:12 Issue with h/w ecc based NAND driver Han Chang
2006-08-30 16:37 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox