mtd: nand: pxa3xx: read_page() returns max_bitflips
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Tue Jan 28 00:59:01 EST 2014
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4e86fd22af2c930e741536e8637bca9355fa8bb5
Commit: 4e86fd22af2c930e741536e8637bca9355fa8bb5
Parent: 664c7f5e81df12b5cac873a25fa9ac9cc90c13c3
Author: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
AuthorDate: Thu Nov 7 12:17:13 2013 -0300
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Jan 3 11:22:10 2014 -0800
mtd: nand: pxa3xx: read_page() returns max_bitflips
As per the ecc.read_page() prototype, we must return the maximum number
of bitflips that were corrected on any one region covering an ecc step.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
Tested-by: Daniel Mack <zonque at gmail.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/nand/pxa3xx_nand.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index c10cb06..f25d71b 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -751,6 +751,7 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
{
struct pxa3xx_nand_host *host = mtd->priv;
struct pxa3xx_nand_info *info = host->info_data;
+ int max_bitflips = 0;
chip->read_buf(mtd, buf, mtd->writesize);
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
@@ -758,6 +759,7 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
if (info->retcode == ERR_SBERR) {
switch (info->use_ecc) {
case 1:
+ max_bitflips = 1;
mtd->ecc_stats.corrected++;
break;
case 0:
@@ -776,7 +778,7 @@ static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
mtd->ecc_stats.failed++;
}
- return 0;
+ return max_bitflips;
}
static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd)
More information about the linux-mtd-cvs
mailing list