public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Steve deRosier <derosier@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Tobi Wulff <Tobi.Wulff@alliedtelesis.co.nz>
Subject: Re: NAND ecc-strength (was Re: NAND timeout issues with blank chip and Marvell NFC)
Date: Mon, 30 Apr 2018 08:06:25 +0200	[thread overview]
Message-ID: <20180430080625.3ae2e324@bbrezillon> (raw)
In-Reply-To: <2847aa9260084a6da170afe239a33d36@svr-chch-ex1.atlnz.lc>

Hi Chris,

On Sun, 29 Apr 2018 22:17:08 +0000
Chris Packham <Chris.Packham@alliedtelesis.co.nz> wrote:

> Hi Boris & all,
> 
> Permit me a slight tangent.
> 
> On 27/04/18 18:16, Boris Brezillon wrote:
> >> The one problem it does have in this configuration is the familiar
> >> "nand: WARNING: pxa3xx_nand-0: the ECC used on your system is too weak
> >> compared to the one required by the NAND chip". From what I read in the
> >> Marvell datasheet even though the chip requires 8-bits of ECC per 540
> >> bytes of data the 16-bits per 2048 bytes of data implemented by the
> >> controller should satisfy this.  
>  >
> > No, it's not true. Well, it will work for some time, and then fail when
> > too many erase cycles have been done on a block. You should always try
> > to at least meet the chip requirements. Anyway, that's not really the
> > issue here.
> >   
> >> If I set marvell,nand-keep-config or nand-ecc-strength = <8>. I get ECC
> >> errors reported (probably due to the change in configuration) and
> >> ultimately the mount fails "mount: mounting ubi0:user on /flash failed:
> >> Invalid argument" I haven't really dug into where that's coming from.  
>  >
> > For the ECC change, that's not surprising, since u-boot probably writes
> > things in the 4bit/512 config.
> >   
> 
> So this raises a bit of concern. A certain NAND flash vendor has 
> released an end of life notice for some of their chips (I won't name 
> them specifically because I'm not sure if there is a NDA in place). The 
> suggested replacement part requires 8bit/540byte ECC whereas the old one 
> required 4bit/540byte.
> 
> The first problem I face is how do we handle the possibility of having 
> either chip installed. Since the current dtb has ecc-strength = <4> do 
> we need the bootloader to modify this on the fly this based on some 
> identifier that distinguishes old from new? Or is there some way of 
> saying ecc-strength = <pick a value appropriate for the chip>.

Do not define these properties in the DT and the driver should pick the
values extracted during the chip detection
(chip->ecc_{strength,step}_ds). If these values are 0, that means the
detection codes fails to extract the ECC requirements and
nand_<vendor>.c file should be patched to address that.

As an alternative, you could define 'nand-ecc-maximize' in the DT and
patch the driver to auto-select the maximum ECC strength when
NAND_ECC_MAXIMIZE is set in chip->ecc.options. This way you're
guaranteed that, no matter the chip you use, the driver will maximize
the ECC strength.

> 
> The second problem is that, if I understand correctly, the Marvell NFCv2 
> BCH implementation is always 16bit/2048bytes. So even if I get the dts 
> to say the right thing the hardware based ECC will ignore it.

Actually, the controller does 16bits/Xbytes. So, say you have a
requirement of 8bits/512bytes, you can just convert that to
16bits/1024bytes.

Regards,

Boris

      reply	other threads:[~2018-04-30  6:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-29 22:17 NAND ecc-strength (was Re: NAND timeout issues with blank chip and Marvell NFC) Chris Packham
2018-04-30  6:06 ` Boris Brezillon [this message]

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=20180430080625.3ae2e324@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=Chris.Packham@alliedtelesis.co.nz \
    --cc=Tobi.Wulff@alliedtelesis.co.nz \
    --cc=derosier@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox