[PATCH] mtd: rawnand: atmel: Update ecc_stats.corrected counter

Subsystems: memory technology devices (mtd), microchip nand driver, nand flash subsystem, the rest

STALE1951d LANDED

Landed in mainline as 33cebf701e98 on 2021-03-28.

2 messages, 2 authors, 2021-03-28 · open the first message on its own page

[PATCH] mtd: rawnand: atmel: Update ecc_stats.corrected counter

From: Tudor Ambarus <hidden>
Date: 2021-03-22 15:08:23

From: "Kai Stuhlemmer (ebee Engineering)" <redacted>

Update MTD ECC statistics with the number of corrected bits.

Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: stable@vger.kernel.org
Signed-off-by: Kai Stuhlemmer (ebee Engineering) <redacted>
Signed-off-by: Tudor Ambarus <redacted>
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index e6ceec8f50dc..8aab1017b460 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -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;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH] mtd: rawnand: atmel: Update ecc_stats.corrected counter

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2021-03-28 17:15:35

On Mon, 2021-03-22 at 15:07:14 UTC, Tudor Ambarus wrote:
From: "Kai Stuhlemmer (ebee Engineering)" <redacted>

Update MTD ECC statistics with the number of corrected bits.

Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: stable@vger.kernel.org
Signed-off-by: Kai Stuhlemmer (ebee Engineering) <redacted>
Signed-off-by: Tudor Ambarus <redacted>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help