Skip to content

Commit

Permalink
mtd: nand: brcmnand: Zero bitflip is not an error
Browse files Browse the repository at this point in the history
A negative return value of brcmstb_nand_verify_erased_page() indicates a
real bitflip error of an erased page, and other return values (>= 0) show
the corrected bitflip number. Zero return value means no bitflip, but the
current driver code treats it as an error, and eventually leads to
falsely reported ECC error.

Fixes: 02b88ee ("mtd: brcmnand: Add check for erased page bitflip")
Signed-off-by: Albert Hsieh <[email protected]>
Acked-by: Boris Brezillon <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
hsiehwt authored and richardweinberger committed Dec 15, 2017
1 parent fdf2e82 commit e44b9a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/nand/brcmnand/brcmnand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ static int brcmnand_read(struct mtd_info *mtd, struct nand_chip *chip,
err = brcmstb_nand_verify_erased_page(mtd, chip, buf,
addr);
/* erased page bitflips corrected */
if (err > 0)
if (err >= 0)
return err;
}

Expand Down

0 comments on commit e44b9a9

Please sign in to comment.