All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/8] mtd: nand: sunxi: Fix strength minimum value
Date: Wed, 24 Jan 2018 23:19:53 +0100	[thread overview]
Message-ID: <20180124231953.2785a39b@xps13> (raw)
In-Reply-To: <20180124085723.5d1ed71d@bbrezillon>

Hello Boris,

On Wed, 24 Jan 2018 08:57:23 +0100
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> On Wed, 24 Jan 2018 01:44:47 +0100
> Miquel Raynal <miquel.raynal@free-electrons.com> wrote:
> 
> > When no requirement in Device Tree is given about the ECC strength and
> > step size, the engine should fallback on the minimal working case for
> > this engine (16b/1024B) instead of the NAND chip requirement which might
> > be simply unreachable.  
> 
> Actually, this is not what this patch is fixing. It fixes all cases
> where the requested ECC strength does not exactly match the strengths
> supported by the ECC engine. In this case, the driver is selecting the
> closest strength meeting the 'selected_strength > requested_strength'
> constraint. The problem was that we were not updating ecc->strength
> with the real strength, which is what you're fixing here.

That is entirely right, I kept one explanation on the easiest case
where this is needed: when there is not ECC-related property in the DT.

> 
> > 
> > Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
> > ---
> >  drivers/mtd/nand/sunxi_nand.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> > index 8bc3828854..e8e7ad8ac5 100644
> > --- a/drivers/mtd/nand/sunxi_nand.c
> > +++ b/drivers/mtd/nand/sunxi_nand.c
> > @@ -1417,6 +1417,7 @@ static int sunxi_nand_hw_common_ecc_ctrl_init(struct mtd_info *mtd,
> >  		goto err;
> >  	}
> >  
> > +	ecc->strength = strengths[i];
> >  	data->mode = i;
> >  
> >  	/* HW ECC always request ECC bytes for 1024 bytes blocks */  
> 



-- 
Miquel Raynal, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2018-01-24 22:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  0:44 [U-Boot] [PATCH 0/8] Bring NAND support to Nintendo NES Classic Miquel Raynal
2018-01-24  0:44 ` [U-Boot] [PATCH 1/8] mtd: nand: sunxi: Fix strength minimum value Miquel Raynal
2018-01-24  7:46   ` Maxime Ripard
2018-01-24 22:21     ` Miquel Raynal
2018-01-24  7:57   ` Boris Brezillon
2018-01-24 22:19     ` Miquel Raynal [this message]
2018-01-24  0:44 ` [U-Boot] [PATCH 2/8] spl: nand: sunxi: Fix second case of modulo by zero error Miquel Raynal
2018-01-24  7:47   ` Maxime Ripard
2018-01-24 22:32     ` Miquel Raynal
2018-01-24  0:44 ` [U-Boot] [PATCH 3/8] sunxi: Allow SPL to be compiled for sun8i platforms Miquel Raynal
2018-01-24  7:49   ` Maxime Ripard
2018-01-24 22:37     ` Miquel Raynal
2018-01-24  0:44 ` [U-Boot] [PATCH 4/8] spl: nand: sunxi: Enhancements and cleaning Miquel Raynal
2018-01-24  7:56   ` Maxime Ripard
2018-01-25 23:34     ` Miquel Raynal
2018-01-24  8:06   ` Boris Brezillon
2018-01-25 23:37     ` Miquel Raynal
2018-01-24  0:44 ` [U-Boot] [PATCH 5/8] spl: nand: sunxi: use PIO instead of DMA Miquel Raynal
2018-01-24  8:06   ` Maxime Ripard
2018-01-24  8:26     ` Boris Brezillon
2018-01-24  8:39       ` Maxime Ripard
2018-01-25 23:58     ` Miquel Raynal
2018-01-24  8:16   ` Boris Brezillon
2018-01-26  0:09     ` Miquel Raynal
2018-01-24  0:44 ` [U-Boot] [PATCH 6/8] configs: Add NAND support for NES Classic Miquel Raynal
2018-01-24  8:10   ` Maxime Ripard
2018-01-24  0:44 ` [U-Boot] [PATCH 7/8] sunxi: dts: Add NAND node to sun8i DTSI Miquel Raynal
2018-01-24  8:16   ` Maxime Ripard
2018-01-24  0:44 ` [U-Boot] [PATCH 8/8] sunxi: dts: Enable NAND on NES classic Miquel Raynal
2018-01-24  8:18   ` Boris Brezillon

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=20180124231953.2785a39b@xps13 \
    --to=miquel.raynal@free-electrons.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.