Skip to contentSkip to conversation

mtd: rawnand: atmel: Update ecc_stats.corrected counter

PATCH Applied Tudor Ambarus 2 participants 2 messages Mar 22, 2021 – Mar 28, 2021

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

PATCH 1/1 mtd: rawnand: atmel: Update ecc_stats.corrected counter

From: "Kai Stuhlemmer (ebee Engineering)" <[email protected]>

Update MTD ECC statistics with the number of corrected bits.

Fixes f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +4 -2
index e6ceec8f50dc..8aab1017b460 100644
@@ -883,10 +883,12 @@ static int atmel_nand_pmecc_correct_data(struct nand_chip *chip, void *buf,
 							  NULL, 0,
 							  chip->ecc.strength);
 
-		if (ret >= 0)
+		if (ret >= 0) {
+			mtd->ecc_stats.corrected += ret;
 			max_bitflips = max(ret, max_bitflips);
-		else
+		} else {
 			mtd->ecc_stats.failed++;
+		}
 
 		databuf += chip->ecc.size;
 		eccbuf += chip->ecc.bytes;
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Tudor Ambarus

From: "Kai Stuhlemmer (ebee Engineering)" <[email protected]>

Update MTD ECC statistics with the number of corrected bits.

Fixes f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel