All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>,
	Richard Weinberger <richard@nod.at>,
	Rob Herring <robh+dt@kernel.org>,
	linux-mtd@lists.infradead.org
Subject: Re: [RESEND v5 07/21] mtd: rawnand: Create a new enumeration to describe OOB placement
Date: Wed, 27 May 2020 10:22:57 +0200	[thread overview]
Message-ID: <20200527102257.788fc5a0@collabora.com> (raw)
In-Reply-To: <20200527100050.7e54713a@xps13>

On Wed, 27 May 2020 10:00:50 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Hi Boris,
> 
> Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed, 27 May
> 2020 00:39:04 +0200:
> 
> > On Tue, 26 May 2020 21:56:19 +0200
> > Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >   
> > > There is currently a confusion between the ECC type/mode/provider
> > > (eg. hardware, software, on-die or none) and the ECC bytes placement.
> > > 
> > > Create a new enumeration to describe this placement.
> > > 
> > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > > Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> > > ---
> > >  drivers/mtd/nand/raw/nand_base.c |  4 ++++
> > >  include/linux/mtd/rawnand.h      | 12 ++++++++++++
> > >  2 files changed, 16 insertions(+)
> > > 
> > > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> > > index ef70ca0828c3..a4470a19c805 100644
> > > --- a/drivers/mtd/nand/raw/nand_base.c
> > > +++ b/drivers/mtd/nand/raw/nand_base.c
> > > @@ -5018,6 +5018,10 @@ static const char * const nand_ecc_modes[] = {
> > >  	[NAND_ECC_ON_DIE]	= "on-die",
> > >  };
> > >  
> > > +static const char * const nand_ecc_placement[] = {
> > > +	[NAND_ECC_PLACEMENT_INTERLEAVED] = "interleaved",
> > > +};
> > > +
> > >  static int of_get_nand_ecc_mode(struct device_node *np)
> > >  {
> > >  	const char *pm;
> > > diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> > > index 8187056dd3a0..6eb4d91b07eb 100644
> > > --- a/include/linux/mtd/rawnand.h
> > > +++ b/include/linux/mtd/rawnand.h
> > > @@ -92,6 +92,18 @@ enum nand_ecc_mode {
> > >  	NAND_ECC_ON_DIE,
> > >  };
> > >  
> > > +/**
> > > + * enum nand_ecc_placement - NAND ECC placement
> > > + * @NAND_ECC_PLACEMENT_FREE: The driver can decide where to put ECC bytes.    
> > 
> > Can we name that one UNDEFINED instead of FREE, and it's not really the
> > driver that decides (unless you have a choice or use SW ECC), more the ECC
> > engine itself.  
> 
> Ack.
> 
> >   
> > > + *                           Default behavior is to put them at the end of the
> > > + *                           OOB area.    
> > 
> > I wouldn't even define a default behavior here, but instead add a value for
> > OOB/TAIL placement.  
> 
> This is for legacy reasons, maybe I should not say it is a default, but
> rather a common location (or say nothing).

I wouldn't even mention what the most common pattern is. But I think
defining @NAND_ECC_PLACEMENT_OOB is a good thing.

> 
> >   
> > > + * @NAND_ECC_PLACEMENT_INTERLEAVED: Syndrome layout: interleave data and OOB.    
> > 
> > 
> > 									     ^ECC bytes
> >   
> > > + */
> > > +enum nand_ecc_placement {
> > > +	NAND_ECC_PLACEMENT_FREE,
> > > +	NAND_ECC_PLACEMENT_INTERLEAVED,
> > > +};
> > > +
> > >  enum nand_ecc_algo {
> > >  	NAND_ECC_UNKNOWN,
> > >  	NAND_ECC_HAMMING,    
> >   


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>,
	<linux-mtd@lists.infradead.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, <devicetree@vger.kernel.org>
Subject: Re: [RESEND v5 07/21] mtd: rawnand: Create a new enumeration to describe OOB placement
Date: Wed, 27 May 2020 10:22:57 +0200	[thread overview]
Message-ID: <20200527102257.788fc5a0@collabora.com> (raw)
In-Reply-To: <20200527100050.7e54713a@xps13>

On Wed, 27 May 2020 10:00:50 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Hi Boris,
> 
> Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed, 27 May
> 2020 00:39:04 +0200:
> 
> > On Tue, 26 May 2020 21:56:19 +0200
> > Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >   
> > > There is currently a confusion between the ECC type/mode/provider
> > > (eg. hardware, software, on-die or none) and the ECC bytes placement.
> > > 
> > > Create a new enumeration to describe this placement.
> > > 
> > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > > Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> > > ---
> > >  drivers/mtd/nand/raw/nand_base.c |  4 ++++
> > >  include/linux/mtd/rawnand.h      | 12 ++++++++++++
> > >  2 files changed, 16 insertions(+)
> > > 
> > > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> > > index ef70ca0828c3..a4470a19c805 100644
> > > --- a/drivers/mtd/nand/raw/nand_base.c
> > > +++ b/drivers/mtd/nand/raw/nand_base.c
> > > @@ -5018,6 +5018,10 @@ static const char * const nand_ecc_modes[] = {
> > >  	[NAND_ECC_ON_DIE]	= "on-die",
> > >  };
> > >  
> > > +static const char * const nand_ecc_placement[] = {
> > > +	[NAND_ECC_PLACEMENT_INTERLEAVED] = "interleaved",
> > > +};
> > > +
> > >  static int of_get_nand_ecc_mode(struct device_node *np)
> > >  {
> > >  	const char *pm;
> > > diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> > > index 8187056dd3a0..6eb4d91b07eb 100644
> > > --- a/include/linux/mtd/rawnand.h
> > > +++ b/include/linux/mtd/rawnand.h
> > > @@ -92,6 +92,18 @@ enum nand_ecc_mode {
> > >  	NAND_ECC_ON_DIE,
> > >  };
> > >  
> > > +/**
> > > + * enum nand_ecc_placement - NAND ECC placement
> > > + * @NAND_ECC_PLACEMENT_FREE: The driver can decide where to put ECC bytes.    
> > 
> > Can we name that one UNDEFINED instead of FREE, and it's not really the
> > driver that decides (unless you have a choice or use SW ECC), more the ECC
> > engine itself.  
> 
> Ack.
> 
> >   
> > > + *                           Default behavior is to put them at the end of the
> > > + *                           OOB area.    
> > 
> > I wouldn't even define a default behavior here, but instead add a value for
> > OOB/TAIL placement.  
> 
> This is for legacy reasons, maybe I should not say it is a default, but
> rather a common location (or say nothing).

I wouldn't even mention what the most common pattern is. But I think
defining @NAND_ECC_PLACEMENT_OOB is a good thing.

> 
> >   
> > > + * @NAND_ECC_PLACEMENT_INTERLEAVED: Syndrome layout: interleave data and OOB.    
> > 
> > 
> > 									     ^ECC bytes
> >   
> > > + */
> > > +enum nand_ecc_placement {
> > > +	NAND_ECC_PLACEMENT_FREE,
> > > +	NAND_ECC_PLACEMENT_INTERLEAVED,
> > > +};
> > > +
> > >  enum nand_ecc_algo {
> > >  	NAND_ECC_UNKNOWN,
> > >  	NAND_ECC_HAMMING,    
> >   


  reply	other threads:[~2020-05-27  8:23 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 19:56 [RESEND v5 00/21] Introduce the generic ECC engine abstraction Miquel Raynal
2020-05-26 19:56 ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 01/21] mtd: Fix typo in mtd_ooblayout_set_databytes() description Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-27 14:11   ` Miquel Raynal
2020-05-27 14:11     ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 02/21] mtd: rawnand: Avoid a typedef Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-27 14:11   ` Miquel Raynal
2020-05-27 14:11     ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 03/21] mtd: rawnand: Drop OOB_FIRST placement scheme Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 22:46   ` Boris Brezillon
2020-05-26 22:46     ` Boris Brezillon
2020-05-27 14:11   ` Miquel Raynal
2020-05-27 14:11     ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 04/21] dt-bindings: mtd: Deprecate OOB_FIRST mode Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 22:42   ` Boris Brezillon
2020-05-26 22:42     ` Boris Brezillon
2020-05-27 14:11   ` Miquel Raynal
2020-05-27 14:11     ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 05/21] mtd: rawnand: Return an enum from of_get_nand_ecc_algo() Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 22:41   ` Boris Brezillon
2020-05-26 22:41     ` Boris Brezillon
2020-05-27 14:11   ` Miquel Raynal
2020-05-27 14:11     ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 06/21] mtd: rawnand: Add an invalid ECC mode to discriminate with valid ones Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-27 14:11   ` Miquel Raynal
2020-05-27 14:11     ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 07/21] mtd: rawnand: Create a new enumeration to describe OOB placement Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 22:39   ` Boris Brezillon
2020-05-26 22:39     ` Boris Brezillon
2020-05-27  8:00     ` Miquel Raynal
2020-05-27  8:00       ` Miquel Raynal
2020-05-27  8:22       ` Boris Brezillon [this message]
2020-05-27  8:22         ` Boris Brezillon
2020-05-26 19:56 ` [RESEND v5 08/21] mtd: rawnand: Separate the ECC engine type and the " Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 09/21] mtd: rawnand: Create a new enumeration to describe properly ECC types Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 22:55   ` Boris Brezillon
2020-05-26 22:55     ` Boris Brezillon
2020-05-26 23:21     ` Boris Brezillon
2020-05-26 23:21       ` Boris Brezillon
2020-05-27  8:21     ` Miquel Raynal
2020-05-27  8:21       ` Miquel Raynal
2020-05-26 22:59   ` Boris Brezillon
2020-05-26 22:59     ` Boris Brezillon
2020-05-27  8:33     ` Miquel Raynal
2020-05-27  8:33       ` Miquel Raynal
2020-05-27  8:44       ` Boris Brezillon
2020-05-27  8:44         ` Boris Brezillon
2020-05-27  8:50         ` Boris Brezillon
2020-05-27  8:50           ` Boris Brezillon
2020-05-26 19:56 ` [RESEND v5 10/21] mtd: rawnand: Create a helper to retrieve the ECC placement Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 11/21] mtd: rawnand: Use the new ECC engine type enumeration Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 12/21] mtd: rawnand: Deprecate nand-ecc-mode in favor of nand-ecc-provider Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 23:03   ` Boris Brezillon
2020-05-26 23:03     ` Boris Brezillon
2020-05-27  8:42     ` Miquel Raynal
2020-05-27  8:42       ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 13/21] mtd: rawnand: Drop the legacy ECC type enumeration Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 14/21] dt-bindings: mtd: Add the nand-ecc-placement property Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 23:08   ` Boris Brezillon
2020-05-26 23:08     ` Boris Brezillon
2020-05-26 23:10   ` Rob Herring
2020-05-26 23:10     ` Rob Herring
2020-05-26 19:56 ` [RESEND v5 15/21] dt-bindings: mtd: Deprecate hw_syndrome from the ECC modes Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 23:09   ` Boris Brezillon
2020-05-26 23:09     ` Boris Brezillon
2020-05-26 19:56 ` [RESEND v5 16/21] dt-bindings: mtd: Deprecate the nand-ecc-mode property Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 23:12   ` Boris Brezillon
2020-05-26 23:12     ` Boris Brezillon
2020-05-26 19:56 ` [RESEND v5 17/21] mtd: nand: Move nand_device forward declaration to the top Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 18/21] mtd: nand: Add an extra level in the Kconfig hierarchy Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 19/21] mtd: nand: Drop useless 'depends on' in Kconfig Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 20/21] mtd: nand: Add a NAND page I/O request type Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal
2020-05-26 19:56 ` [RESEND v5 21/21] mtd: nand: Rename a core structure Miquel Raynal
2020-05-26 19:56   ` Miquel Raynal

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=20200527102257.788fc5a0@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@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.