From: Tom Rini <trini@konsulko.com>
To: David Rivshin <drivshin@awxrd.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] nand: gpmc: Handle bitflips in erased pages when using BCH ECC engine
Date: Mon, 17 Jan 2022 13:36:17 -0500 [thread overview]
Message-ID: <20220117183617.GT2631111@bill-the-cat> (raw)
In-Reply-To: <20211118182524.3043611-1-drivshin@awxrd.com>
[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]
On Thu, Nov 18, 2021 at 01:25:24PM -0500, David Rivshin wrote:
> From: David Rivshin <DRivshin@allworx.com>
>
> In the case of an erased (sub)page both the data and ECC are all 0xFF
> bytes. This fails the normal ECC verification, as the computed ECC of
> all-0xFF is not also 0xFF. The GPMC NAND driver attempted to detect
> erased pages by checking that the ECC bytes are all-0xFF, but this had
> two problems:
> 1) bitflips in the data were not corrected, so the data looked not-erased
> 2) bitflips in the ECC bytes were reported as uncorrectable ECC errors
>
> The equivalent Linux driver [1] correctly handles this by counting the
> number of 0-bits in the combination of data and ECC bytes. If the number
> of 0-bits is less than the amount of bits correctable by the selected
> ECC algorithm, then it is treated as an erased page with correctable
> bitflips.
>
> Implement similar, though simplified, logic in omap_correct_data_bch().
>
> [1] see omap_elm_correct_data() in omap2.c
>
> Signed-off-by: David Rivshin <drivshin@allworx.com>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2022-01-17 18:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 18:25 [PATCH] nand: gpmc: Handle bitflips in erased pages when using BCH ECC engine David Rivshin
2022-01-17 18:36 ` Tom Rini [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=20220117183617.GT2631111@bill-the-cat \
--to=trini@konsulko.com \
--cc=drivshin@awxrd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox