public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [NAND flash driver] What would mtd do if read returns -EBADMSG (ecc failed)
@ 2008-10-21  6:11 Du Zhongdong
  2008-10-21  6:21 ` Artem Bityutskiy
  2008-10-21  6:50 ` Ricard Wanderlof
  0 siblings, 2 replies; 6+ messages in thread
From: Du Zhongdong @ 2008-10-21  6:11 UTC (permalink / raw)
  To: linux-mtd

Hi,

I'm doing a NAND flash driver, and I suppose if ecc cannot be
corrected while read something from NAND flash, that block should be
marked bad, is that right?

Reading through nand_base.c I notice that mtd->read = nand_read;
nand_read() [MTD Interface] calls nand_do_read_ops() [Internal] to do
the work,  and in nand_do_read_ops():
        if (mtd->ecc_stats.failed - stats.failed)
		return -EBADMSG;
-EBADMSG then is returned to the MTD layer. I tried to trace this
information in the MTD code, but there seems to be so many and I
cannot be sure how MTD handles this "-EBADMSG".  Any help or
information is appreciated.


Best regards,
Du Zhongdong

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

end of thread, other threads:[~2008-10-21  7:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-21  6:11 [NAND flash driver] What would mtd do if read returns -EBADMSG (ecc failed) Du Zhongdong
2008-10-21  6:21 ` Artem Bityutskiy
     [not found]   ` <7ccead5b0810202351n5db8e66ep1fbec555707950f6@mail.gmail.com>
2008-10-21  7:09     ` Artem Bityutskiy
2008-10-21  7:36       ` Du Zhongdong
2008-10-21  6:50 ` Ricard Wanderlof
     [not found]   ` <7ccead5b0810202358l60368b79q2aae53bd1afc218@mail.gmail.com>
     [not found]     ` <Pine.LNX.4.64.0810210915260.6120@lnxricardw.se.axis.com>
2008-10-21  7:39       ` Du Zhongdong

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