[U-Boot] [PATCH] nand: fix reading after switching ecc

Nikita Kiryanov nikita at compulab.co.il
Sun Jan 12 10:27:17 CET 2014


Hi Jeroen,

On 01/11/2014 03:39 PM, Jeroen Hofstee wrote:
> 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 at freescale.com>
> Cc: Pekon Gupta <pekon at ti.com>
> Cc: Nikita Kiryanov <nikita at compulab.co.il>
> Signed-off-by: Jeroen Hofstee <jeroen at 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;
>

Tested on cm_t35.

Acked-by: Nikita Kiryanov <nikita at compulab.co.il>
Tested-by: Nikita Kiryanov <nikita at compulab.co.il>

-- 
Regards,
Nikita.


More information about the U-Boot mailing list