All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, 1/2] mtd: nand: omap: fix sw->hw->sw ecc switch
Date: Tue, 17 Dec 2013 17:47:22 -0600	[thread overview]
Message-ID: <20131217234722.GA27126@home.buserror.net> (raw)
In-Reply-To: <1387214342-7411-2-git-send-email-nikita@compulab.co.il>

On Mon, Dec 16, 2013 at 07:19:01PM +0200, Nikita Kiryanov wrote:
> When switching ecc mode, omap_select_ecc_scheme() assigns the appropriate values
> into the current nand chip's ecc.layout struct. This is done under the
> assumption that the struct exists only to store values, so it is OK to overwrite
> it, but there is at least one situation where this assumption is incorrect:
> 
> When switching to 1 bit hamming code sw ecc, the job of assigning layout data
> is outsourced to nand_scan_tail(), which simply assigns into ecc.layout a
> pointer to an existing struct prefilled with the appropriate values. This struct
> doubles as both data and layout definition, and therefore shouldn't be
> overwritten, but on the next switch to hardware ecc, this is exactly what's
> going to happen. The next time the user switches to software ecc, they're
> going to get a messed up ecc layout.
> 
> Prevent this and possible similar bugs by explicitly using the
> private-to-omap_gpmc.c omap_ecclayout struct when switching ecc mode.
> 
> Cc: Scott Wood <scottwood@freescale.com>
> Cc: Pekon Gupta <pekon@ti.com>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> 
> ---
> drivers/mtd/nand/omap_gpmc.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Applied to u-boot-nand-flash.git

-Scott

  reply	other threads:[~2013-12-17 23:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 17:19 [U-Boot] [PATCH 0/2] omap_gpmc nand ecc switch bug fixes Nikita Kiryanov
2013-12-16 17:19 ` [U-Boot] [PATCH 1/2] mtd: nand: omap: fix sw->hw->sw ecc switch Nikita Kiryanov
2013-12-17 23:47   ` Scott Wood [this message]
2013-12-16 17:19 ` [U-Boot] [PATCH 2/2] mtd: nand: omap: fix ecc ops assignment when changing ecc Nikita Kiryanov
2013-12-16 23:03   ` Scott Wood
2013-12-17 13:16     ` Nikita Kiryanov
2013-12-17 13:18   ` [U-Boot] [PATCH V2 " Nikita Kiryanov
2013-12-17 23:49     ` [U-Boot] [U-Boot, V2, " Scott Wood

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=20131217234722.GA27126@home.buserror.net \
    --to=scottwood@freescale.com \
    --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.