diff options
author | Thomas Gleixner <tglx@cruncher.tec.linutronix.de> | 2006-05-29 08:56:39 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@cruncher.tec.linutronix.de> | 2006-05-29 09:06:51 -0400 |
commit | 9a1fcdfd4bee27c418424cac47abf7c049541297 (patch) | |
tree | 5baa5f1e1d1a296a319bf6a5a4b636668c107e00 /drivers/mtd/nftlcore.c | |
parent | 8593fbc68b0df1168995de76d1af38eb62fd6b62 (diff) |
[MTD] NAND Signal that a bitflip was corrected by ECC
Return -EUCLEAN on read when a bitflip was detected and corrected, so the
clients can react and eventually copy the affected block to a spare one.
Make all in kernel users aware of the change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/nftlcore.c')
-rw-r--r-- | drivers/mtd/nftlcore.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index f6ffe7949b26..dc7573501d8c 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c | |||
@@ -422,7 +422,7 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p | |||
422 | 422 | ||
423 | ret = mtd->read(mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512), | 423 | ret = mtd->read(mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512), |
424 | 512, &retlen, movebuf); | 424 | 512, &retlen, movebuf); |
425 | if (ret < 0) { | 425 | if (ret < 0 && ret != -EUCLEAN) { |
426 | ret = mtd->read(mtd, (nftl->EraseSize * BlockMap[block]) | 426 | ret = mtd->read(mtd, (nftl->EraseSize * BlockMap[block]) |
427 | + (block * 512), 512, &retlen, | 427 | + (block * 512), 512, &retlen, |
428 | movebuf); | 428 | movebuf); |
@@ -768,7 +768,9 @@ static int nftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block, | |||
768 | } else { | 768 | } else { |
769 | loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs; | 769 | loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs; |
770 | size_t retlen; | 770 | size_t retlen; |
771 | if (mtd->read(mtd, ptr, 512, &retlen, buffer)) | 771 | int res = mtd->read(mtd, ptr, 512, &retlen, buffer); |
772 | |||
773 | if (res < 0 && res != -EUCLEAN) | ||
772 | return -EIO; | 774 | return -EIO; |
773 | } | 775 | } |
774 | return 0; | 776 | return 0; |