This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

flash filesystem problems with linux 3.10

Other Parts Discussed in Thread: OMAP-L138

I'm running OMAP-L138 on the LogicPD evaluation board. I try to use a portion of NOR flash for a flash file system. The /dev/mtdX interface seems to work well. I'm able to write and read data and from the flash. Also I've run mtd_tests (http://www.linux-mtd.infradead.org/doc/general.html#L_mtd_tests) succesfully (speedtest, readtest and stresstest). However, when I try use a flash file system (JFFS2 or UBI) I end up with a corrupted filesystem or UBI won't attach. The problems occur when I use linux davinci kernel 3.10. At least jffs2 works when I use 3.3. kernel (TI PSP kernel without TI patches). So the problem seems to be related to the kernel version. Please, any ideas what could be the cause of my problems? Here's a log of what I try to do:

# mtdinfo /dev/mtd5
mtd5
Name:                           Ramdisk 2
Type:                           nor
Eraseblock size:                65536 bytes, 64.0 KiB
Amount of eraseblocks:          24 (1572864 bytes, 1.5 MiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:10
Bad blocks are allowed:         false
Device is writable:             true

# flash_erase -j /dev/mtd5 0 0
Erasing 64 Kibyte @ 0 --  0 % complete flash_erase:  Cleanmarker written at 0
Erasing 64 Kibyte @ 10000 --  4 % complete flash_erase:  Cleanmarker written at 10000
Erasing 64 Kibyte @ 20000 --  8 % complete flash_erase:  Cleanmarker written at 20000
Erasing 64 Kibyte @ 30000 -- 12 % complete flash_erase:  Cleanmarker written at 30000
Erasing 64 Kibyte @ 40000 -- 16 % complete flash_erase:  Cleanmarker written at 40000
Erasing 64 Kibyte @ 50000 -- 20 % complete flash_erase:  Cleanmarker written at 50000
Erasing 64 Kibyte @ 60000 -- 25 % complete flash_erase:  Cleanmarker written at 60000
Erasing 64 Kibyte @ 70000 -- 29 % complete flash_erase:  Cleanmarker written at 70000
Erasing 64 Kibyte @ 80000 -- 33 % complete flash_erase:  Cleanmarker written at 80000
Erasing 64 Kibyte @ 90000 -- 37 % complete flash_erase:  Cleanmarker written at 90000
Erasing 64 Kibyte @ a0000 -- 41 % complete flash_erase:  Cleanmarker written at a0000
Erasing 64 Kibyte @ b0000 -- 45 % complete flash_erase:  Cleanmarker written at b0000
Erasing 64 Kibyte @ c0000 -- 50 % complete flash_erase:  Cleanmarker written at c0000
Erasing 64 Kibyte @ d0000 -- 54 % complete flash_erase:  Cleanmarker written at d0000
Erasing 64 Kibyte @ e0000 -- 58 % complete flash_erase:  Cleanmarker written at e0000
Erasing 64 Kibyte @ f0000 -- 62 % complete flash_erase:  Cleanmarker written at f0000
Erasing 64 Kibyte @ 100000 -- 66 % complete flash_erase:  Cleanmarker written at 100000
Erasing 64 Kibyte @ 110000 -- 70 % complete flash_erase:  Cleanmarker written at 110000
Erasing 64 Kibyte @ 120000 -- 75 % complete flash_erase:  Cleanmarker written at 120000
Erasing 64 Kibyte @ 130000 -- 79 % complete flash_erase:  Cleanmarker written at 130000
Erasing 64 Kibyte @ 140000 -- 83 % complete flash_erase:  Cleanmarker written at 140000
Erasing 64 Kibyte @ 150000 -- 87 % complete flash_erase:  Cleanmarker written at 150000
Erasing 64 Kibyte @ 160000 -- 91 % complete flash_erase:  Cleanmarker written at 160000
Erasing 64 Kibyte @ 170000 -- 95 % complete flash_erase:  Cleanmarker written at 170000
Erasing 64 Kibyte @ 170000 -- 100 % complete
# mount  -t jffs2 /dev/mtdblock5 /mnt
# df
Filesystem                Size      Used Available Use% Mounted on
172.16.23.114:/home/jnikula/targetfs
                        220.1G     82.8G    126.1G  40% /
/dev/mtdblock5            1.5M    196.0K      1.3M  13% /mnt
# cp -r /etc /mnt/
jffs2: Node totlen on flash (0x00000003) != totlen from node ref (0x00000044)
jffs2: Node totlen on flash (0x0000006f) != totlen from node ref (0x00000044)
jffs2: Node totlen on flash (0x000000e7) != totlen from node ref (0x00000044)
jffs2: Node totlen on flash (0x00000138) != totlen from node ref (0x00000044)
jffs2: Node totlen on flash (0x000000fa) != totlen from node ref (0x00000044)
jffs2: Node totlen on flash (0x00000003) != totlen from node ref (0x00000044)
jffs2: Node totlen on flash (0x00000003) != totlen from node ref (0x00000044)
jffs2: Node totlen on flash (0x00000066) != totlen from node ref (0x00000044)
# df
Filesystem                Size      Used Available Use% Mounted on
172.16.23.114:/home/jnikula/targetfs
                        220.1G     82.8G    126.1G  40% /
/dev/mtdblock5            1.5M    216.0K      1.3M  14% /mnt
# umount /mnt
# mount  -t jffs2 /dev/mtdblock5 /mnt
jffs2: jffs2_scan_eraseblock(): Node at 0x0016000c {0x1985, 0xc002, 0x00000044) has invalid CRC 0x00000000 (calculated 0x98f7fb1d)
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160010: 0x0044 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160018: 0x0002 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160034: 0x0458 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0016004c: 0xdf84 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0016007c: 0x8b40 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160080: 0x0003 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160088: 0x30d4 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0016008c: 0xbe70 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160090: 0x0d34 instead
jffs2: Further such events for this erase block will not be printed
jffs2: jffs2_scan_inode_node(): CRC failed on node at 0x0016031c: Read 0xc1f343ab, calculated 0x7bbf10e0
jffs2: jffs2_scan_inode_node(): CRC failed on node at 0x00160490: Read 0xf9bd0596, calculated 0xbd638931
jffs2: jffs2_scan_inode_node(): CRC failed on node at 0x00160694: Read 0x1f90322c, calculated 0x0e28a78e
jffs2: Empty flash at 0x00160904 ends at 0x00160920
jffs2: Empty flash at 0x00161a2c ends at 0x00161a48
jffs2: jffs2_scan_inode_node(): CRC failed on node at 0x00161b18: Read 0x8c0e7caf, calculated 0xf2539c39
# jffs2: notice: (585) check_node_data: wrong data CRC in data node at 0x001612bc: read 0x000000, calculated 0xb1ceb4de.
jffs2: warning: (585) jffs2_do_read_inode_internal: no data nodes found for ino #19
jffs2: Returned error for crccheck of ino #19. Expect badness...
jffs2: notice: (585) check_node_data: wrong data CRC in data node at 0x00161f88: read 0x000000, calculated 0x2b123151.
jffs2: warning: (585) jffs2_do_read_inode_internal: no data nodes found for ino #27
jffs2: Returned error for crccheck of ino #27. Expect badness...
jffs2: notice: (585) check_node_data: wrong data CRC in data node at 0x001623ec: read 0x000000, calculated 0x7118f2d7.
jffs2: warning: (585) jffs2_do_read_inode_internal: no data nodes found for ino #29
jffs2: Returned error for crccheck of ino #29. Expect badness...

#

regards,

Jouko Nikula

  • This was kernel configuration problem after all. CONFIG_CPU_DCACHE_WRITETHROUGH needs to be enabled for JFFS2 to work on OMAP- L138.

    Can someone explain why I was able to read/write mtd devices without problems but jffs2 had problems? Should JFFS2 configuration option be dependant on CONFIG_CPU_DCACHE_WRITETHROUGH on DA850?