linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: docg4: ecc.read_page() returns 0 on uncorrectible errors
@ 2012-09-11 15:50 Mike Dunn
  2012-09-15  3:20 ` Brian Norris
  2012-09-24 15:17 ` Artem Bityutskiy
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Dunn @ 2012-09-11 15:50 UTC (permalink / raw)
  To: linux-mtd; +Cc: Mike Dunn

Currently the docg4's ecc.read_page() method returns -EBADMSG when uncorrectible
bitflips occur.  This is wrong; 0 should be returned in this case.  An error
code should only be returned by this method in the case of a hardware error
(probably -EIO).

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
 drivers/mtd/nand/docg4.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
index 793921e..deb718c 100644
--- a/drivers/mtd/nand/docg4.c
+++ b/drivers/mtd/nand/docg4.c
@@ -776,6 +776,8 @@ static int read_page(struct mtd_info *mtd, struct nand_chip *nand,
 	}
 
 	writew(0, docptr + DOC_DATAEND);
+	if (bits_corrected == -EBADMSG)	  /* uncorrectible errors */
+		return 0;
 	return bits_corrected;
 }
 
-- 
1.7.3.4

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

end of thread, other threads:[~2012-09-24 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-11 15:50 [PATCH] mtd: nand: docg4: ecc.read_page() returns 0 on uncorrectible errors Mike Dunn
2012-09-15  3:20 ` Brian Norris
2012-09-15 18:08   ` Mike Dunn
2012-09-24 15:17 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).