From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] Why data corrected by ecc are not rewrite to the flash?
Date: Tue, 15 Jun 2010 13:01:29 +0200 [thread overview]
Message-ID: <4C175D89.4020006@free.fr> (raw)
In-Reply-To: <AANLkTikV1wyzcjLr2lIr4cPAvf_vw-pnmO361mWk2_lL@mail.gmail.com>
Le 15/06/2010 12:42, Ivan Nardi a ?crit :
> Hello!
>
> I'am having a look at the ecc algorithms in nand code and I observe (both in
> kernel and in u-boot) that when ecc corrects some data, corrected data are
> given to the user, but the data storage in the nand do not change. In other
> words, I expected the flash would be written with the new (corrected) data.
>
> Why data corrected by ecc are not rewrite to the flash?
>
> I think that it should be easy achieve this goal. In the read function, if
> ecc corrects some data on a page, I read the entire block, erase it and
> write back (correct) data to the flash.
>
> Nobody is interested in this feature? Or is it more difficult than I think?
>
> Thanks a lot!
Let me play the devil's advocate here: what would be the interest of
writing back corrected data to the flash? Here's my take at the pros and
cons of writing ECC-corrected data back to flash:
Cons:
- risk of the write failing more or less critically;
- performance hit (albeit marginal hopefully);
- risk of spurious data corruption: if the ECC detection/correction or
write decision code is buggy, you may end up with a write-back where
unnecessary, and possibly write the wrong data back to flash. The
current situation, at least, guarantees that the Flash content is
preserved even if ECC detection/correction gets it wrong.
Pros:
- marginal performance gain for subsequent reads of ECC, assuming the
data is read frequently enough that the correction time becomes
significant wrt all the rest of the bootloader execution.
But the bottom line is: there is no benefit as far as the data itself is
concerned since it is correct without writing it back to Flash.
Amicalement,
--
Albert.
next prev parent reply other threads:[~2010-06-15 11:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-15 10:42 [U-Boot] Why data corrected by ecc are not rewrite to the flash? Ivan Nardi
2010-06-15 11:01 ` Albert ARIBAUD [this message]
2010-06-15 12:52 ` Ivan Nardi
2010-06-15 11:40 ` [U-Boot] Why data corrected by ecc are not rewrite to the flash? " Wolfgang Denk
2010-06-15 12:56 ` Ivan Nardi
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=4C175D89.4020006@free.fr \
--to=albert.aribaud@free.fr \
--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