From: Iwo Mergler <iwo.mergler@netcommwireless.com>
To: Richard Weinberger <richard.weinberger@gmail.com>,
Johan Borkhuis <maillist@borkhuis.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: UBIFS automatic recovery
Date: Mon, 16 May 2016 17:23:23 +1000 [thread overview]
Message-ID: <5739756B.4050305@netcommwireless.com> (raw)
In-Reply-To: <CAFLxGvwDGBnf61eco1tQwRCC_BvUZTBF0Q4bLpB74JkRb3JP2g@mail.gmail.com>
On 05/13/2016 07:11 PM, Richard Weinberger wrote:
> No. What you need is figuring out*why* UBIFS breaks while doing
> power cuts. Both UBI and UBIFS are power cut aware by design.
> In most cases UBIFS suffers from MTD problems. May it a faulty driver
> or bad hardware...
Johan,
check if your NAND driver can handle erased pages
with bit errors (0-bits). The drivers from the
old TI Arago tree for the am3x processors didn't,
for instance.
The NAND is expected to contain all '1's after erasure.
Unfortunately, unlike the 1-bit (Hamming) ECC, most
multi-bit (BCH) ECC schemes use a code that flags an
uncorrectable error if both the page and the ECC area
are '1'.
It's annoying - at chip implementation time, a few
extra transistors would have avoided that.
In software, the NAND driver now gets an 'uncorrectable'
error and must check if the page is, in fact, erased. If
it is, it pretends success.
A popular way of checking for erasure is to compare
the ECC syndrome to the known value for an erased page.
Which works fine, as long as you don't have any '0' bits
in it. If you do, the workaround fails and UBI experiences
an "uncorrectable" page.
Most of the time UBIFS doesn't verify erased pages, so
you get away with it. But in times of stress - recovery
or in-the-gaps allocation, for instance - erased pages
are being verified and UBIFS tends to go read-only or
fail the mount on error.
So, make sure that your NAND driver checks the entire
data payload of an erased page for '1' bits, but allows
a small number of '0' bits. Then applies a memset(1)
to the buffer before handing it to MTD.
Best regards,
Iwo
prev parent reply other threads:[~2016-05-16 7:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 8:47 UBIFS automatic recovery Johan Borkhuis
2016-05-13 9:11 ` Richard Weinberger
2016-05-13 10:27 ` Johan Borkhuis
2016-05-13 13:57 ` Richard Weinberger
2016-05-16 7:23 ` Iwo Mergler [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=5739756B.4050305@netcommwireless.com \
--to=iwo.mergler@netcommwireless.com \
--cc=linux-mtd@lists.infradead.org \
--cc=maillist@borkhuis.com \
--cc=richard.weinberger@gmail.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;
as well as URLs for NNTP newsgroup(s).