mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: omap: Return corrected bits for BCH
@ 2017-06-06 15:49 Daniel Schultz
  0 siblings, 0 replies; only message in thread
From: Daniel Schultz @ 2017-06-06 15:49 UTC (permalink / raw)
  To: barebox

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.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
 drivers/mtd/nand/nand_omap_gpmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index e18ce63..05c8486 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -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;
 }
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-06 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 15:49 [PATCH] mtd: nand: omap: Return corrected bits for BCH Daniel Schultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox