ubifs robustness with early power cut warning

Kees Trommel ctrommel at aimvalley.nl
Mon Oct 2 01:06:21 PDT 2017


Doug,

Attached a patch file with an implementation that I developed for our 
custom board that has an early powerdown (is dying) signal (GPIO pin).

The idea is that when an "I am dying" condition is detected no erase or 
program is started by the mtd layer. It is assumed that an erase or 
program started before the board starts to die will be completed 
successfully.

Kees.

On 09/30/17 01:20, Doug Crawford wrote:
> We have an embedded system with an early power loss warning.  The
> power supply drives a powerdown signal connected to a GPIO pin on the
> CPU.  When AC power is switched off the power supply drives this
> signal low for 500 milliseconds before the CPU gets held in reset.  If
> AC power is switched back on before 500 milliseconds the powerdown
> signal goes high again and the system is expected to continue running
> normally.
>
> I am wondering if there is a way to easily modify ubifs/ubi such that
> when the powerdown gpio is low VFS or UBIFS or UBI freezes or pauses
> further writes to the NAND.  If powerdown recovers to high again then
> the filesystem would unfreeze and allow further writes?  Has anyone
> implemented something like this before?  I know UBIFS/UBI is designed
> to be very resilient to power cuts, but I am thinking this technique
> might make the system even more resilient.  If I were to make this
> change which file would be the right one to hook into:
> fs/ubifs/super.c?
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mtd_dying.patch
Type: text/x-patch
Size: 6999 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20171002/6d871cb1/attachment-0001.bin>


More information about the linux-mtd mailing list