mtd: rawnand: atmel: Update ecc_stats.corrected counter
commit33cebf701eupstream. Update MTD ECC statistics with the number of corrected bits. Fixes:f88fc122cc("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
907452b3b6
commit
706e60c192
1 changed files with 4 additions and 2 deletions
|
|
@ -883,10 +883,12 @@ static int atmel_nand_pmecc_correct_data(struct nand_chip *chip, void *buf,
|
||||||
NULL, 0,
|
NULL, 0,
|
||||||
chip->ecc.strength);
|
chip->ecc.strength);
|
||||||
|
|
||||||
if (ret >= 0)
|
if (ret >= 0) {
|
||||||
|
mtd->ecc_stats.corrected += ret;
|
||||||
max_bitflips = max(ret, max_bitflips);
|
max_bitflips = max(ret, max_bitflips);
|
||||||
else
|
} else {
|
||||||
mtd->ecc_stats.failed++;
|
mtd->ecc_stats.failed++;
|
||||||
|
}
|
||||||
|
|
||||||
databuf += chip->ecc.size;
|
databuf += chip->ecc.size;
|
||||||
eccbuf += chip->ecc.bytes;
|
eccbuf += chip->ecc.bytes;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue