All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] nand: fix reading after switching ecc
@ 2014-01-11 13:39 Jeroen Hofstee
  2014-01-12  9:27 ` Nikita Kiryanov
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jeroen Hofstee @ 2014-01-11 13:39 UTC (permalink / raw)
  To: u-boot

The omap_gpmc allows switching ecc at runtime. Since
the NAND_SUBPAGE_READ flag is only set, it is kept when
switching to hw ecc, which is not correct. This leads to
calling chip->ecc.read_subpage which is not a valid
pointer. Therefore also clear the flag so reading in
hw mode works again.

Cc: Scott Wood <scottwood@freescale.com>
Cc: Pekon Gupta <pekon@ti.com>
Cc: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---
 drivers/mtd/nand/nand_base.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 1ce55fd..0762a19 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3354,6 +3354,8 @@ int nand_scan_tail(struct mtd_info *mtd)
 	/* Large page NAND with SOFT_ECC should support subpage reads */
 	if ((chip->ecc.mode == NAND_ECC_SOFT) && (chip->page_shift > 9))
 		chip->options |= NAND_SUBPAGE_READ;
+	else
+		chip->options &= ~NAND_SUBPAGE_READ;
 
 	/* Fill in remaining MTD driver data */
 	mtd->type = MTD_NANDFLASH;
-- 
1.8.3.2

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

end of thread, other threads:[~2014-01-17 13:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-11 13:39 [U-Boot] [PATCH] nand: fix reading after switching ecc Jeroen Hofstee
2014-01-12  9:27 ` Nikita Kiryanov
2014-01-13  8:29 ` Gupta, Pekon
2014-01-13 18:18   ` Scott Wood
2014-01-14 20:11     ` Jeroen Hofstee
2014-01-14 20:21       ` Scott Wood
2014-01-14 20:38         ` Jeroen Hofstee
2014-01-14 20:41           ` Scott Wood
2014-01-14 20:56             ` Jeroen Hofstee
2014-01-14 21:05               ` Scott Wood
2014-01-14 21:15                 ` Jeroen Hofstee
2014-01-14 21:17                   ` Scott Wood
2014-01-15  5:56       ` Gupta, Pekon
2014-01-15 16:58 ` [U-Boot] [PATCH v2] nand, gpmc: " Jeroen Hofstee
2014-01-17 13:06   ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.