Emergency synch/umount/shutdown of UBIFS on NAND

Michel Benoit michel at nube.nu
Fri Jan 10 03:44:47 EST 2014


Hello mtd-list,

We've got linux 3.10.x running on a custom board with Atmel
AT91SAM9X25 SoC and a 4Gb NAND from Micron (MT29F4G08ABADA).

The NAND is formatted with UBIFS partitions for rootfs and a user
disk. The rootfs disk is RO and the user disk partition is R/W.

The board is designed so that if the power supply suddenly drops the
CPU, RAM and NAND have ~50ms to perform an emergency shutdown.

What can the kernel do in 50ms that minimizes the risk for problems
with UBI, UBIFS and the NAND?

An interrupt input signal is activated when the voltage drops below
the critical level. Some options I have been considering are:

- kernelspace notifies userspace which umounts the ubifs partitions
- call sync() from kernelspace
- call emergency_sync() from kernelspace

The risk with these options is that there is no way to know if they
will complete i 50ms and they initiate activity on the NAND disk which
increases the risk that the NAND will be performing a program or erase
operation at the moment the power to CPU and NAND drop off after 50
ms.

What I really want to do is tell the system to complete any ongoing
program or erase operations that affect the NAND and then block all
other operations.

Is there support for this kind of emergency shutdown in UBIFS? Or does
that kind of shutdown belong at the MTD or NAND driver levels?

Any other tips for how to handle emergency shutdown are appreciated.

/Michel



More information about the linux-mtd mailing list