public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mxc_nand: fix err_limit and err_mask
@ 2014-06-26 20:42 Michael Grzeschik
  2014-06-26 20:42 ` [PATCH 2/2] mxc_nand: use our own read_page function Michael Grzeschik
  2014-07-22  3:21 ` [PATCH 1/2] mxc_nand: fix err_limit and err_mask Brian Norris
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Grzeschik @ 2014-06-26 20:42 UTC (permalink / raw)
  To: linux-mtd; +Cc: dwmw2, linux-kernel, kernel

This patch fixes the error detection limits for the used
eccsize of the 1, 4 and 8 bit eccmode.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/mtd/nand/mxc_nand.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index cb6c845..7fd495e 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -657,10 +657,14 @@ static int mxc_nand_correct_data_v2_v3(struct mtd_info *mtd, u_char *dat,
 	u32 ecc_stat, err;
 	int no_subpages = 1;
 	int ret = 0;
-	u8 ecc_bit_mask, err_limit;
+	u8 ecc_bit_mask, err_limit = 0x1;
 
-	ecc_bit_mask = (host->eccsize == 4) ? 0x7 : 0xf;
-	err_limit = (host->eccsize == 4) ? 0x4 : 0x8;
+	ecc_bit_mask = 0xf;
+
+	if (host->eccsize == 4)
+		err_limit = 0x2;
+	else if (host->eccsize == 8)
+		err_limit = 0x4;
 
 	no_subpages = mtd->writesize >> 9;
 
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-07-22 19:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-26 20:42 [PATCH 1/2] mxc_nand: fix err_limit and err_mask Michael Grzeschik
2014-06-26 20:42 ` [PATCH 2/2] mxc_nand: use our own read_page function Michael Grzeschik
2014-06-27  9:19   ` Michael Grzeschik
2014-06-27 10:38   ` [PATH v2] " Michael Grzeschik
2014-07-05 14:45     ` Michael Grzeschik
2014-07-14 13:28       ` Michael Grzeschik
2014-07-14 19:19     ` Brian Norris
2014-07-22 10:09       ` Michael Grzeschik
2014-07-22 19:23         ` Brian Norris
2014-07-22  3:21 ` [PATCH 1/2] mxc_nand: fix err_limit and err_mask Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox