From: Simon Arlott <simon@fire.lp0.eu>
To: Jonas Gorski <jogo@openwrt.org>
Cc: Brian Norris <computersforpeace@gmail.com>,
Kamal Dasu <kdasu.kdev@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
MTD Maling List <linux-mtd@lists.infradead.org>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH] mtd: brcmnand: Workaround false ECC uncorrectable errors
Date: Wed, 2 Dec 2015 20:17:22 +0000 [thread overview]
Message-ID: <565F51D2.4010204@simon.arlott.org.uk> (raw)
In-Reply-To: <CAOiHx=nMZwQK9ESw9Ggqc6pHWqYQriB-t2eWq++pke8cXhvupw@mail.gmail.com>
On 01/12/15 10:41, Jonas Gorski wrote:
> On Sat, Nov 28, 2015 at 8:23 PM, Simon Arlott <simon@fire.lp0.eu> wrote:
>> +
>> + /* Go to start of buffer */
>> + buf -= FC_WORDS;
>> +
>> + /* Erased if all data bytes are 0xFF */
>> + buf_erased = memchr_inv(buf, 0xFF, FC_WORDS) == NULL;
>> +
>> + if (!buf_erased)
>> + goto out_free;
>
> We now have a function exactly for that use case in 4.4,
> nand_check_erased_buf [1], consider using that. This also has the
> benefit of treating bit flips as correctable as long as the ECC scheme
> is strong enough.
I have no idea whether or not it's appropriate to specify
bitflips_threshold > 0 so it'd just be a more complex way to do
a memchr_inv() search for 0xFF.
The code also has to check for the hamming code bytes being all 0x00,
because according to the comments [2], the controller also has
difficulty with the non-erased all-0xFFs scenario too.
[2] https://github.com/lp0/bcm963xx_4.12L.06B_consumer/blob/dd8fcb13046f738c311507dc2fcfd3e5d57a88e0/kernel/linux/drivers/mtd/brcmnand/brcmnand_base.c#L2459
>
> Jonas
>
> [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/mtd/nand/nand_base.c#n1110
>
--
Simon Arlott
next prev parent reply other threads:[~2015-12-02 20:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-28 19:23 [PATCH] mtd: brcmnand: Workaround false ECC uncorrectable errors Simon Arlott
2015-12-01 10:41 ` Jonas Gorski
2015-12-02 20:17 ` Simon Arlott [this message]
2015-12-02 20:44 ` Jonas Gorski
2015-12-02 20:54 ` Brian Norris
2015-12-02 21:06 ` Brian Norris
2015-12-02 21:08 ` Jonas Gorski
2015-12-02 21:29 ` Simon Arlott
2015-12-02 22:22 ` Brian Norris
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=565F51D2.4010204@simon.arlott.org.uk \
--to=simon@fire.lp0.eu \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=f.fainelli@gmail.com \
--cc=jogo@openwrt.org \
--cc=kdasu.kdev@gmail.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;
as well as URLs for NNTP newsgroup(s).