Skip to content

Commit

Permalink
mtd: rawnand: atmel: Update ecc_stats.corrected counter
Browse files Browse the repository at this point in the history
Update MTD ECC statistics with the number of corrected bits.

Fixes: f88fc12 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: stable@vger.kernel.org
Signed-off-by: Kai Stuhlemmer (ebee Engineering) <kai.stuhlemmer@ebee.de>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210322150714.101585-1-tudor.ambarus@microchip.com
  • Loading branch information
Kai Stuhlemmer (ebee Engineering) authored and Miquel Raynal committed Mar 28, 2021
1 parent 1200c7f commit 33cebf7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mtd/nand/raw/atmel/nand-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 33cebf7

Please sign in to comment.