All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikita Kiryanov <nikita@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] nand: fix reading after switching ecc
Date: Sun, 12 Jan 2014 11:27:17 +0200	[thread overview]
Message-ID: <52D25FF5.5040602@compulab.co.il> (raw)
In-Reply-To: <1389447588-17529-1-git-send-email-jeroen@myspectrum.nl>

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@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;
>

Tested on cm_t35.

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

-- 
Regards,
Nikita.

  reply	other threads:[~2014-01-12  9:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-11 13:39 [U-Boot] [PATCH] nand: fix reading after switching ecc Jeroen Hofstee
2014-01-12  9:27 ` Nikita Kiryanov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52D25FF5.5040602@compulab.co.il \
    --to=nikita@compulab.co.il \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.