From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/5] introduce nand write.ubi, and drop ffs for jffs2 too
Date: Mon, 02 May 2011 15:14:27 +0200 [thread overview]
Message-ID: <m28vupgs7g.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1304085554.2737.58.camel@localhost> (Artem Bityutskiy's message of "Fri, 29 Apr 2011 16:59:14 +0300")
Hi Artem,
> On Fri, 2011-04-29 at 13:58 +0200, Detlev Zundel wrote:
>> Hi Ben,
>>
>> > It was found that on da850evm, where the NAND ECC used does not map all 0xff
>> > data to 0xff ECC, that flashing UBI and JFFS2 image from U-boot with nand
>> > write[.e] command resulted in alot of ECC errors... for UBI the result was
>> > an unmountable filesystem on second attach from linux. For JFFS2 the result was
>> > a multitude of ECC errors printed on the cosole on the second mount in Linux --
>> > the filesystem remains mountable for awhile but eventually collapses.
>>
>> I am not sure that I can follow you here so I have to ask you to clarify
>> the problem for me.
>>
>> I understand that a page of 0xffs does _not_ have an ECC of all 0xffs.
>> Actually I would be surprised if there was any ECC having this property,
>> so I doubt that this is da850 specific, correct?
>>
>> So I am wondering about two things:
>>
>> - If I erase a page in NAND, will the ECC be updated by someone or will
>> it be 0xffs? If the latter, then is it "normal" to have ECC errors on
>> freshly erased pages?
>>
>> - If we (correctly) "write" 0xffs even to an erased page, a generated
>> ECC should match this content, so I do not see where ECC errors should
>> come from in this setting.
>>
>> Summarily, I do not understand where the ECC errors came from in your
>> setup and what the faulting party in that scenario actually is/was.
>>
>> Can you please enlighten me?
>
> I do not know why I'm in CC, but I see that the code to skip all 0xFFs
> looks like it was copied from UBI. The reason why UBI and UBI user-space
> tools skip NAND pages with all 0xFFs when writing is described here:
>
> http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo
>
> If it is too long to read, in short:
>
> 1. if we write to flash, we always write to an erased eraseblock,
> obviously :-)
Yes - I simply wasn't sure if the software layers below (in U-Boot)
would do an "erase on demand" before writing. Reading the code, this
isn't the case (I should have known this), so the skipping should really
be safe.
> 2. erased erase block contains all 0xFFs, so skipping 0xFF NAND pages is
> harmless.
> 3. writing 0xFF pages has side-effects - the ECC bytes in OOB will be
> used
> 4. If we are flashing an UBIFS image, UBIFS will use the half-filled
> eraseblocks, and if the "free" pages were written with 0xFFs, they'll
> become unusable.
>
> So we skip 0xFF pages at the end. Not all, only the last ones. E.g., if
> your eraseblock consists of 4 pages, and you write "data, 0xFFs, data,
> 0xFFs", then we'll only write "data, 0xFFs, data", so that the last NAND
> page can be used later.
>
> Sorry for my poor English, and I'm writing in a hurry - have to have to
> a pub to farewell several colleagues who are leaving the company :)
Thanks for your input.
So I still fail to see where the ECC errors come from. The closes thing
that makes sense for me, is that Bens problem very likely wasn't ECC
connected at all but the result of the "not capable to write twice".
I.e. his NAND flashes cannot be written to twice. When he flashed the
images in U-Boot, there were trailing empty blocks that got programmed
and UBIFS assumed that it _could_ write to them so it tried and failed
and somehow got tripped up over this.
If this is the case then we should change the commit message to point to
the real problem that this patch fixes.
Cheers
Detlev
--
``The number of UNIX installations has grown to 10,
with more expected.'' Unix Programmers Manual -- 1972
The number of UNIX variants has grown to dozens,
with more expected. -- 2001
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
next prev parent reply other threads:[~2011-05-02 13:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 21:47 [U-Boot] [PATCH 0/5] introduce nand write.ubi, and drop ffs for jffs2 too Ben Gardiner
2011-04-28 21:47 ` [U-Boot] [PATCH 1/5] nand_base: trivial: fix comment read/write comment Ben Gardiner
2011-04-28 21:47 ` [U-Boot] [PATCH 2/5] nand_util: convert nand_write_skip_bad() to flags Ben Gardiner
2011-04-29 11:44 ` Detlev Zundel
2011-04-28 21:47 ` [U-Boot] [PATCH 3/5] nand_util: drop trailing all-0xff pages if requested Ben Gardiner
2011-04-28 21:47 ` [U-Boot] [PATCH 4/5] cmd_nand: add nand write.ubi command Ben Gardiner
2011-04-29 11:52 ` Detlev Zundel
2011-04-28 21:47 ` [U-Boot] [PATCH 5/5] cmd_nand: also drop 0xff pages for jffs2 Ben Gardiner
2011-04-29 11:58 ` [U-Boot] [PATCH 0/5] introduce nand write.ubi, and drop ffs for jffs2 too Detlev Zundel
2011-04-29 13:59 ` Artem Bityutskiy
2011-05-02 13:14 ` Detlev Zundel [this message]
2011-05-11 21:04 ` Ben Gardiner
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=m28vupgs7g.fsf@ohwell.denx.de \
--to=dzu@denx.de \
--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