1 From 97598678602aaea473303523ce37a45d258206ca Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Thu, 7 Nov 2013 12:17:13 -0300
4 Subject: [PATCH 134/203] mtd: nand: pxa3xx: read_page() returns max_bitflips
6 As per the ecc.read_page() prototype, we must return the maximum number
7 of bitflips that were corrected on any one region covering an ecc step.
9 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
10 Tested-by: Daniel Mack <zonque@gmail.com>
11 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
13 drivers/mtd/nand/pxa3xx_nand.c | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
16 --- a/drivers/mtd/nand/pxa3xx_nand.c
17 +++ b/drivers/mtd/nand/pxa3xx_nand.c
18 @@ -751,6 +751,7 @@ static int pxa3xx_nand_read_page_hwecc(s
20 struct pxa3xx_nand_host *host = mtd->priv;
21 struct pxa3xx_nand_info *info = host->info_data;
22 + int max_bitflips = 0;
24 chip->read_buf(mtd, buf, mtd->writesize);
25 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
26 @@ -758,6 +759,7 @@ static int pxa3xx_nand_read_page_hwecc(s
27 if (info->retcode == ERR_SBERR) {
28 switch (info->use_ecc) {
31 mtd->ecc_stats.corrected++;
34 @@ -776,7 +778,7 @@ static int pxa3xx_nand_read_page_hwecc(s
35 mtd->ecc_stats.failed++;
39 + return max_bitflips;
42 static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd)