Skip to contentSkip to conversation

mtd: nand: omap: Return corrected bits for BCH

PATCH New Daniel Schultz 1 participant 1 message Jun 6, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: nand: omap: Return corrected bits for BCH

If using ECC mode OMAP_ECC_HAMMING_CODE_HW_ROMCODE (which is default for all AM335x with DTS support) the page_read function won't return the corrected bitflips.

---
 drivers/mtd/nand/nand_omap_gpmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mtd/nand/nand_omap_gpmc.c +4 -2
index e18ce63..05c8486 100644
@@ -707,10 +707,12 @@ static int omap_gpmc_read_page_bch_rom_mode(struct mtd_info *mtd,
 	__omap_calculate_ecc(mtd, buf, ecc_calc, 1);
 
 	stat = omap_correct_bch(mtd, buf, ecc_code, ecc_calc);
-	if (stat < 0)
+	if (stat < 0) {
 		mtd->ecc_stats.failed++;
-	else
+	} else {
 		mtd->ecc_stats.corrected += stat;
+		return stat;
+	}
 
 	return 0;
 }
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox