[Yaffs] Re: power fail testing

Thomas Gleixner tglx@linutronix.de
Sun, 22 May 2005 23:53:05 +0200


On Sun, 2005-05-22 at 10:14 +1200, Charles Manning wrote:

> YAFFS currently assumes that a power failure will not destroy a write. For 
> the most par that should be an OK assumption since once a flash programming 
> cycle has been set up it should execute in 200uS. THere should be enough 
> residual power in the system to complete that.

Hmm, thats a dangerous assumption. Assume that the WP pin is switched to
write protect mode by a reset controller which supervises the power
supply. 

You have to handle interrupted writes. There is no guarantee for
"atomic" programming operations. And all hacks you put into the mtd/nand
layer or YAFFS will not improve the situation. Keep this stuff as simple
as possible and handle the rare case of interrupted page programming in
the mount stage.

tglx