Skip to content

Commit 5bf3d66

Browse files
mike-dunnDavid Woodhouse
authored andcommitted
mtd: docg4: ecc.read_page() returns 0 on uncorrectable errors
Currently the docg4's ecc.read_page() method returns -EBADMSG when uncorrectable 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> Acked-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent 61de9da commit 5bf3d66

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/mtd/nand/docg4.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,8 @@ static int read_page(struct mtd_info *mtd, struct nand_chip *nand,
776776
}
777777

778778
writew(0, docptr + DOC_DATAEND);
779+
if (bits_corrected == -EBADMSG) /* uncorrectable errors */
780+
return 0;
779781
return bits_corrected;
780782
}
781783

0 commit comments

Comments
 (0)