mtd: rawnand: omap2: Fix number of bitflips reporting with ELM

omap_elm_correct_data() returns the number of bitflips for the whole
page. This is wrong, it should return the maximum number of bitflips
found in each ECC step.

In my case with a 4k page size NAND mtcdore reported -EUCLEAN with
only 12 bitflips on a page where we could correct up to 128 bits per
page (provided they are distributed equally on the 8 ECC steps)

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
Sascha Hauer 2019-08-27 12:36:53 +02:00 коммит произвёл Miquel Raynal
Родитель 7f852cc157
Коммит f480b96944
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -1501,7 +1501,7 @@ static int omap_elm_correct_data(struct nand_chip *chip, u_char *data,
}
/* Update number of correctable errors */
stat += err_vec[i].error_count;
stat = max_t(unsigned int, stat, err_vec[i].error_count);
/* Update page data with sector size */
data += ecc->size;