]> git.sur5r.net Git - u-boot/commitdiff
nand, gpmc: fix reading after switching ecc
authorJeroen Hofstee <jeroen@myspectrum.nl>
Wed, 15 Jan 2014 16:58:54 +0000 (17:58 +0100)
committerTom Rini <trini@ti.com>
Fri, 17 Jan 2014 13:04:32 +0000 (08:04 -0500)
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 clear the flag when switching ecc 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/omap_gpmc.c

index 790d5385e0bdc18ec5172f21735f8232265b46e5..389c4de59a1189d6cbc22f51337bab1a56ef9002 100644 (file)
@@ -933,6 +933,7 @@ int __maybe_unused omap_nand_switch_ecc(uint32_t hardware, uint32_t eccstrength)
        mtd = &nand_info[nand_curr_device];
        nand = mtd->priv;
        nand->options |= NAND_OWN_BUFFERS;
+       nand->options &= ~NAND_SUBPAGE_READ;
        /* Setup the ecc configurations again */
        if (hardware) {
                if (eccstrength == 1) {