JFFS2, AT45DB642D dataflash and power failure

Hans Jorgensen hans.jorgensen.news at gmail.com
Mon Jun 4 02:28:50 EDT 2007


Can JFFS2 handle that an entire flash page gets corrupted if a power
failure occurs while calling at91_dataflash_write/dataflash_write? If
not then there might be a problem with
at91_dataflash.c/mtd_dataflash.c

The story is as following:
I am using Linux kernel 2.6.12 + patch 2.6.12 (20/06-2005) from
maxim.org.za and trying to implement transaction based file access
with rollback functionality in a user-space application.

To prove that it would work during power failure I used a watchdog to
activate reset of the CPU and flashes.  It did not work.

As an attempt to make it work I modified at91_dataflash_write to use
the flash commands.
Buffer 1 Write + Buffer 1 to Main Memory Page Program without Built-in Erase
instead of
Main Memory Page Program Through Buffer 1 (which implicit includes an
erase page functionality)

Now it is working and that naturally leads to the question above.
A nice side effect of this change is that writing speed is increased.

Note: this change may not be a valid solution, as this is not the
recommended way of using the dataflash. It would require further
investigation before implementation.

Hans




More information about the linux-mtd mailing list