From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Daniel Palmer <daniel@0x0f.com>
Cc: linux-mtd@lists.infradead.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mtd: spinand: add support for Foresee FS35ND01G-S1Y2
Date: Wed, 7 Apr 2021 10:02:04 +0200 [thread overview]
Message-ID: <20210407100204.08d894ca@xps13> (raw)
In-Reply-To: <CAFr9PXntCmdrmg+i3BB1j-aY4VbE=2iqyLcoSr9cX2090jGiGQ@mail.gmail.com>
Hi Daniel,
Daniel Palmer <daniel@0x0f.com> wrote on Fri, 26 Mar 2021 23:09:28
+0900:
> Hi Miquel,
>
> Sorry for the constant pestering on this..
>
> On Tue, 23 Mar 2021 at 23:06, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > > # nandbiterrs -i /dev/mtd1
> > > incremental biterrors test
> > > Successfully corrected 0 bit errors per subpage
> > > Inserted biterror @ 0/5
> > > Read reported 4 corrected bit errors
> > > ECC failure, invalid data despite read success
> >
> > This is not a valid behavior. There is something wrong with the way ECC
> > status is read/retrieved. The read should indeed report 4 corrected bit
> > errors, but then the data should be valid. Here it means that the
> > introduced error appears corrected but in fact is not.
> > We need to understand what status are available and write the
> > appropriate vendor code.
>
> I looked at the datasheet again and the encoding for ecc status seems
> a bit funky.
> The chip seems to have only two bits for ECC status with this encoding:
> 0 - Read success with 0-3 flipped bits.
> 1 - Read success with 4 flipped bits.
> 2 - Uncorrectable.
> 3 - Reserved.
>
Very nice information.
> This looks almost the same as the Winbond chips with 0 and 1 being successes
> but with no totally error free status.
>
> Anyhow, if 4 bits were corrected is returned for 1 then nandbiterrs
> reports "ECC failure, invalid data despite read success".
> If I return 3 bit errors for 0 and -EBADMSG for anything else
> nandbiterrs doesn't complain anymore but is this right?:
You may look at micron_8_ecc_get_status() helper to guide you. But
IMHO, if there are 0-3 bf, you should probably assume there were 3 bf
and return 3, if there were 4, return 4, if it's uncorrectable return
-EBADMSG otherwise -EINVAL.
We should verify that this does not mess with UBI wear leveling
though. Please check that returning 3-bit errors no matter the
actual number of flipped bits does not lead UBI to move the data away
(I think it's fine but we need to be sure otherwise the implementation
proposal is not valid).
Thanks,
Miquèl
next prev parent reply other threads:[~2021-04-07 8:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-13 9:57 [PATCH v2] mtd: spinand: add support for Foresee FS35ND01G-S1Y2 Daniel Palmer
2021-02-15 10:24 ` Miquel Raynal
2021-02-15 10:53 ` Daniel Palmer
2021-02-15 11:16 ` Miquel Raynal
2021-02-15 11:34 ` Daniel Palmer
2021-03-22 12:44 ` Daniel Palmer
2021-03-22 18:32 ` Miquel Raynal
2021-03-23 9:33 ` Daniel Palmer
2021-03-23 10:32 ` Miquel Raynal
2021-03-23 11:47 ` Daniel Palmer
2021-03-23 14:06 ` Miquel Raynal
2021-03-23 14:14 ` Daniel Palmer
2021-03-26 14:09 ` Daniel Palmer
2021-04-07 8:02 ` Miquel Raynal [this message]
2021-04-07 12:01 ` Daniel Palmer
2021-04-08 15:49 ` 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=20210407100204.08d894ca@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=daniel@0x0f.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/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