On Thursday 08 September 2011 23:11:22 Sebastian Huber wrote:
> Hello,
>
> from the JFFS2 documentation I have this:
>
> http://sourceware.org/jffs2/jffs2-html/node3.html
>
> "The original JFFS simply assumed that any block which appeared at first
> scan to contain 0xFF in every byte was free, and would select the longest
> run of apparently free space at mount time to be the space between the head
> and tail of the log. Unfortunately, extensive power fail testing on JFFS
> proved this to be unwise. For many types of flash chips, if power is lost
> during an erase operation, some bits may be left in an unstable state,
> while most are reset to a logical one. If the initial scan happens to read
> all ones and treat a block containing such unstable bits as usable, then
> data may be lost -- and such data loss may not even be avoidable by the
> naïve method of verification by reading back data immediately by writing,
> because the bit may just happen to return the correct value when read back
> for verification.
>
> Empirical results showed that even rereading the entire contents of the
> block multiple times in an attempt to detect unstable bits was not
> sufficiently reliable to avoid data loss, so an alternative approach was
> required. The accepted solution was to write the marker node to the flash
> block immediately after successful completion of an erase operation. Upon
> encountering flash blocks which do not appear to contain any valid nodes,
> JFFS2 will trigger an erase operation and subsequently write the
> appropriate marker node to the erased block."
>
> Has YAFFS2 a similar mechanism to prevent usage of blocks which had a power
> down during an erase operation?
There is a big difference.
The JFFS2 marker system is designed for for NOR flash. This is absolutely
required because NOR flash erasing typically takes about a second and is thus
highly vulnerable to power loss.
YAFFS is designed for NAND flash. NAND typically erases in a few milliseconds.
There is typically sufficient power rail capacitance to sustain the flash
chip during the erasure.
Where YAFFS is used on NOR then an erasure marker strategy is suggested. There
is an implementation of this in yaffs_norif1.c
-- Charles