Is it an atomic operation for writing a page in NAND flash

Ricard Wanderlof ricard.wanderlof at axis.com
Wed Jan 20 11:35:09 EST 2010


On Wed, 20 Jan 2010, David Parkinson wrote:

> At 14:54 20/01/2010, Ricard Wanderlof wrote:
> >...
> >The end result is that you can't say "if the ECC says it's ok, the data
> >hasn't been corrupted" (which you could with a CRC).
> >...
>
> Apologies for nit-picking (and small digression), but a CRC is no
> guarantee either.  Whilst error correcting codes have additional
> information so that small errors can be corrected both CRCs and ECCs
> work in the same way in detecting likely errors in the communications
> channel.  (It's all maths and statistics....).

You are right of course. Indeed, any mapping of N bits to n bits (where N 
> n) must result in a number of bit patterns for N which map to identical 
bit patterns for n. Still, CRC's used for data checking are designed so 
that the different bit patterns for N that map to the same n n are 
reasonably different from each other, so that a CRC is unlikely to show a 
correct result if there has been a 'typical' failure on the channel. At 
least the ECC algorithm used for mtd has is not intended for that level of 
error detection; it is optimized for correcting single-bit errors.

> A side question here is have the check algorithms been matched to the
> characteristics of the MTDs?  For example a weakish radio signal is
> likely to have errors randomly distributed across the message.  With
> a magnetic disk drive the errors are likely be caused by a blemish on
> the surface and therefore will come in bursts.  Some algorithms will
> be better than others in the respective cases.

The algorithm used in mtd comes from Toshiba I think and was 
originally designed for an old 256 page flash of theirs. But I would think 
all 1-bit-error-correction ECC's are basically the same.

I don't know, but I think the basic premise is that bit errors are rare, 
and when they do occur, they will be single bit errors occurring in random 
places. Indeed, the algorithm used seems to be ideally suited to this 
case.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list