aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/inftlcore.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-29 08:56:39 -0400
committerThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-29 09:06:51 -0400
commit9a1fcdfd4bee27c418424cac47abf7c049541297 (patch)
tree5baa5f1e1d1a296a319bf6a5a4b636668c107e00 /drivers/mtd/inftlcore.c
parent8593fbc68b0df1168995de76d1af38eb62fd6b62 (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/inftlcore.c')
-rw-r--r--drivers/mtd/inftlcore.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
index efb1a95aa0a0..1e21a2c3dd29 100644
--- a/drivers/mtd/inftlcore.c
+++ b/drivers/mtd/inftlcore.c
@@ -355,7 +355,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
355 ret = mtd->read(mtd, (inftl->EraseSize * BlockMap[block]) + 355 ret = mtd->read(mtd, (inftl->EraseSize * BlockMap[block]) +
356 (block * SECTORSIZE), SECTORSIZE, &retlen, 356 (block * SECTORSIZE), SECTORSIZE, &retlen,
357 movebuf); 357 movebuf);
358 if (ret < 0) { 358 if (ret < 0 && ret != -EUCLEAN) {
359 ret = mtd->read(mtd, 359 ret = mtd->read(mtd,
360 (inftl->EraseSize * BlockMap[block]) + 360 (inftl->EraseSize * BlockMap[block]) +
361 (block * SECTORSIZE), SECTORSIZE, 361 (block * SECTORSIZE), SECTORSIZE,
@@ -922,7 +922,10 @@ foundit:
922 } else { 922 } else {
923 size_t retlen; 923 size_t retlen;
924 loff_t ptr = (thisEUN * inftl->EraseSize) + blockofs; 924 loff_t ptr = (thisEUN * inftl->EraseSize) + blockofs;
925 if (mtd->read(mtd, ptr, SECTORSIZE, &retlen, buffer)) 925 int ret = mtd->read(mtd, ptr, SECTORSIZE, &retlen, buffer);
926
927 /* Handle corrected bit flips gracefully */
928 if (ret < 0 && ret != -EUCLEAN)
926 return -EIO; 929 return -EIO;
927 } 930 }
928 return 0; 931 return 0;