[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1480183585-592-12-git-send-email-yamada.masahiro@socionext.com>
Date: Sun, 27 Nov 2016 03:05:57 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: linux-mtd@...ts.infradead.org
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-kernel@...r.kernel.org,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Marek Vasut <marek.vasut@...il.com>,
Brian Norris <computersforpeace@...il.com>,
Richard Weinberger <richard@....at>,
David Woodhouse <dwmw2@...radead.org>,
Cyrille Pitchen <cyrille.pitchen@...el.com>
Subject: [PATCH 11/39] mtd: nand: denali: increment ecc_stats.failed by one per error
If the addressed page is not erased, the two calls of is_erase()
will both return false, then mtd->ecc_stats.failed will be
incremented by two. Rather, increment it by one because the whole
page including OOB area is transferred in one transaction.
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---
drivers/mtd/nand/denali.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index ab59371..ae9a8d2 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1157,9 +1157,8 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,
read_oob_data(mtd, chip->oob_poi, denali->page);
/* check ECC failures that may have occurred on erased pages */
- if (!is_erased(buf, mtd->writesize))
- mtd->ecc_stats.failed++;
- if (!is_erased(chip->oob_poi, mtd->oobsize))
+ if (!is_erased(buf, mtd->writesize) ||
+ !is_erased(chip->oob_poi, mtd->oobsize))
mtd->ecc_stats.failed++;
}
return max_bitflips;
--
2.7.4
Powered by blists - more mailing lists