JFFS2 Garbage Collection causing mtd do_write_buffer timeouts?
Dan Donahue
ddonahue at gridcosystems.com
Sat Jan 5 11:13:07 EST 2013
Greetings,
Some data:
---------------
- proprietary board with ARM processor booting out of CFI NOR flash
- Linux kernel 3.1.0
- BusyBox v1.19.v
- JFFS2 mounted mtdblocks
- using JFFS2 for disk-like storage of images; not using JFFS2 for
root file system (that's in RAM)
summary:
I am seeing intermittent mtd do_write_buffer() timeouts when un'taring a large file (10MB) directly to flash and believe the cause to be a mutex issue with jffs2 garbage collection thread.
details:
Flash status returned in chip_ready() (cfi_cmdset_0002.c) when the timeouts occur indicate "Erase in progress" (DQ3=1, DQ2 toggling, DQ6 toggling), which shouldn't be the case when writing the flash. My guess is there is a mutex issue occurring with the jffs2_gcd_mtdX when it's erasing a block it recently collected.
I've killed the gcd thread and am currently re-running my test. I've yet to see a timeout.
questions:
Could jffs2 garbage collection erase contend with a write operation (especially when the write is large and takes a while)?
If so, then how should garbage collection be turned off when doing large writes to flash?
I've read the gc thread is optional (gc done regardless). Is that true? If so, how do I turn it off? I didn't see an associated configs parameter.
Could it be related to this issue: http://lists.infradead.org/pipermail/linux-mtd/2012-February/039787.html
Thanks for reading this far...
Dan Donahue
Gridco Systems, Inc.
More information about the linux-mtd
mailing list