All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <b32955@freescale.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Kent Li <kent.li@radisys.com>,
	Elie De Brauwer <eliedebrauwer@gmail.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	HOUR Frederic <frederic.hour@safran-engineering.com>,
	linux-mtd@lists.infradead.org, Pekon Gupta <pekon@ti.com>
Subject: Re: [PATCH 1/2] mtd: nand: add erased-page bitflip correction
Date: Tue, 18 Mar 2014 14:48:03 +0800	[thread overview]
Message-ID: <20140318064758.GA12794@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <20140317164635.GX31517@norris-Latitude-E6410>

On Mon, Mar 17, 2014 at 09:46:35AM -0700, Brian Norris wrote:
> On Thu, Mar 13, 2014 at 04:04:27PM +0800, Huang Shijie wrote:
> > On Wed, Mar 12, 2014 at 09:55:19PM -0700, Brian Norris wrote:
> > > On Wed, Mar 12, 2014 at 04:06:07PM +0800, Huang Shijie wrote:
> > > > On Tue, Mar 11, 2014 at 02:11:51AM -0700, Brian Norris wrote:
> > > > > +	/* Check each ECC step individually */
> > > > > +	for (i = 0; i < chip->ecc.steps; i++) {
> > > 
> > > [...]
> > > 
> > > > The gpmi uses a NAND layout like this:
> > > > 
> > > > 	 *    +---+----------+-+----------+-+----------+-+----------+-+
> > > > 	 *    | M |   data   |E|   data   |E|   data   |E|   data   |E|
> > > > 	 *    +---+----------+-+----------+-+----------+-+----------+-+
> > > > 
> > > >         M : The metadata, which is 10 by default.	 
> > > >  	E : The ECC parity for "data" or "data + M".
> > > > 
> > > > If you want to count each sector, it makes the code very complicated. :(
> > > 
> > > I see. That does make things complicated.
> > > 
> > > But I'm curious: why does GPMI's ecc.read_page_raw() implementation (the
> > > default) have to give such a different data/spare layout than its
> > > ecc.read_page() implementation? There seems to be no benefit to this,
> > > except that it means gpmi-nand doesn't have to implement its own
> > > read_page_raw() callback...
> > 
> > The raw data of the NAND is like the diagram above.
> > 
> > Do you mean i should implement the ecc.read_page_raw to read out all
> > the "data"s in the diagram above, and concatenate them together? 
> 
> Yes, that is essentially what I'm suggesting. Is there a good reason to
> have ecc.read_page() and ecc.read_page_raw() look so different to the
> caller? Is it important to see the data exactly as it lays on the flash,
> rather than concatenated to how the driver/hardware interprets it?

[1] Implement the ecc.read_page_raw() is not a easy thing for the GPMI driver.
    The "E"(ECC parity above) can be _NOT_ byte aligned. But the NAND_CMD_RNDOUT
    only works with the byte column.  

    So even you and Pekon have merged this patch set into the MTD, I still prefer to
    do not add the NAND_ECC_NEED_CHECK_FF to the gpmi driver, 
    and implement the specific handle function as i ever sent.

[2] For an erased-page with bitflips, the bitflips can occur at the "E" part too.
    But your patch ignore this case, is it ok? 


> 
> > What is the "raw" data meaning? I feel confused now.
> 
> I did not know there was such a confusion. I simply read this:
> 
>  * @read_page_raw:      function to read a raw page without ECC
> 
> and I assumed it meant that read_page_raw() was the same as read_page(),
> except that there would be no *correction* done on the data. I didn't
> previously think too hard about what it should look like for HW ECC that
> requires shifting/concatenating data around.
> 
> > > Look, for instance, at nand_base's nand_read_page_raw_syndrome(). It
> > > actually bothers to untangle a layout like yours and place it into the
> > > appropriate places in the data and OOB buffers. I think this is the
> > > ideal implementation for read_page_raw(), at which point my patch makes
> > > more sense; all NAND drivers should have a (reasonably) similar layout
> > > when viewed from nand_base, without any mixed data/OOB striping like in
> > > your diagram.
> > We'd better add more comment in the:
> >  * @read_page_raw:	function to read a raw page without ECC
> > 
> > Make it clear that the @read_oob_raw read out the data which do not contain
> > the ECC parity. 
> 
> No, that's not the point; the ECC parity data should still be read out
> from the flash, and IMO, they should be placed in the same location as
> with read_page(). They just shouldn't be used for correction. How about
> this?
> 
>  * @read_page_raw:	function to read a page without correcting for
> 			bitflips
much better to me.

thanks
Huang Shijie

  parent reply	other threads:[~2014-03-18  7:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11  9:11 [PATCH 1/2] mtd: nand: add erased-page bitflip correction Brian Norris
2014-03-11  9:11 ` [PATCH 2/2] mtd: gpmi-nand: use erased-page bitflip check Brian Norris
2014-03-11 10:12 ` [PATCH 1/2] mtd: nand: add erased-page bitflip correction Gupta, Pekon
2014-03-12  5:32   ` Brian Norris
2014-03-12  5:59     ` Elie De Brauwer
2014-03-12  6:59       ` Brian Norris
2014-03-12 12:45         ` Elie De Brauwer
2014-03-13  5:22           ` Brian Norris
2014-03-13  5:55             ` Gupta, Pekon
2014-03-13  6:28               ` Brian Norris
2014-03-13  7:01                 ` Gupta, Pekon
2014-03-17 18:47                   ` Brian Norris
2014-03-18  7:55                     ` Ricard Wanderlof
2014-03-13 12:57                 ` Ezequiel Garcia
2014-03-17 18:53                   ` Brian Norris
2014-03-13  7:37             ` Elie De Brauwer
2014-03-12  8:06 ` Huang Shijie
2014-03-13  4:55   ` Brian Norris
2014-03-13  8:04     ` Huang Shijie
2014-03-17 16:46       ` Brian Norris
2014-03-17 17:50         ` Gupta, Pekon
2014-03-18  6:48         ` Huang Shijie [this message]
2014-03-13 21:32 ` Bill Pringlemeir
2014-03-17 19:46   ` Brian Norris
2014-03-17 22:55     ` Bill Pringlemeir
2014-03-17 23:01       ` Bill Pringlemeir

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=20140318064758.GA12794@shlinux2.ap.freescale.net \
    --to=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=eliedebrauwer@gmail.com \
    --cc=frederic.hour@safran-engineering.com \
    --cc=kent.li@radisys.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pekon@ti.com \
    /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.