[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>
This commit is contained in:
@@ -355,7 +355,7 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
|
||||
ret = mtd->read(mtd, (inftl->EraseSize * BlockMap[block]) +
|
||||
(block * SECTORSIZE), SECTORSIZE, &retlen,
|
||||
movebuf);
|
||||
if (ret < 0) {
|
||||
if (ret < 0 && ret != -EUCLEAN) {
|
||||
ret = mtd->read(mtd,
|
||||
(inftl->EraseSize * BlockMap[block]) +
|
||||
(block * SECTORSIZE), SECTORSIZE,
|
||||
@@ -922,7 +922,10 @@ foundit:
|
||||
} else {
|
||||
size_t retlen;
|
||||
loff_t ptr = (thisEUN * inftl->EraseSize) + blockofs;
|
||||
if (mtd->read(mtd, ptr, SECTORSIZE, &retlen, buffer))
|
||||
int ret = mtd->read(mtd, ptr, SECTORSIZE, &retlen, buffer);
|
||||
|
||||
/* Handle corrected bit flips gracefully */
|
||||
if (ret < 0 && ret != -EUCLEAN)
|
||||
return -EIO;
|
||||
}
|
||||
return 0;
|
||||
|
مرجع در شماره جدید
Block a user