Flash corruption when using UBIFS filesystem on m25p80

Henric Eriksson Henric.Eriksson at brv.se
Tue Jun 24 23:39:16 PDT 2014


Henric Eriksson skrev:
> Hello,
>
> We have a board with a Freescale i.MX28 running Linux kernel 3.14.3
> (Freescale mainline fork). This board has a Spansion S25FL512S Flash
> memory connected with support for Quad SPI communication. We've been
> working for a while now trying to use this as the main rootfs storage
> but have run into problems of Flash corruption when using UBIFS.
>
> $ mount -t ubifs /dev/ubi0_0 tmp/
> UBIFS: background thread "ubifs_bgt0_0" started, PID 480
> UBIFS error (pid 479): ubifs_scan: garbage
> UBIFS error (pid 479): ubifs_scanned_corruption: corruption at LEB 4:0
> UBIFS error (pid 479): ubifs_scanned_corruption: first 8192 bytes from
> LEB 4:0
> UBIFS error (pid 479): ubifs_scan: LEB 4 scanning failed
> UBIFS: background thread "ubifs_bgt0_0" stops
> mount: mounting /dev/ubi0_0 on tmp/ failed: Structure needs cleaning
>
> Subsequent mounts cause it to attempt recovery but it always inevitably
> fails with similar errors.
>

This turned out to be an issue with the underlying SPI driver spi-mxs 
attempting to use DMA mxs-dma for transfers with over 32 bytes in size. 
For some reason, this would corrupt the data. As a workaround we have 
for now disabled DMA access from the SPI driver and have since not 
experienced any issues whatsoever.

/Henric


More information about the linux-mtd mailing list