Skip to contentSkip to conversation

failure to mount partition after flash_eraseall -j

DISCUSSION Jeff Hane 1 participant 1 message Dec 10, 2007 Memory technology devices (MTD)

lore
Share & tools
lore

Jeff Hane

author
#0 lore raw

I've got a nand chip that I've erased using flash_eraseall -j but it
still fails to mount.

It is failing because of the cleanmarker compare is failing.
flash_eraseall writes a cleanmarker of size 8 or less. It gets this length from the *first* oobfree area. In my case, this is 7.
However, when trying to mount the chip and the function
jffs2_check_nand_cleanmarker it does this:
cmlen = min_t(int, c->oobavail, OOB_CM_SIZE);

OOB_CM_SIZE is 8 but oobavail is the total of all the available oob not just the first segment(43 in my case). So them memcmp fails because it tries to compare 8 bytes instead of 7.

Should flash_eraseall try to see if there is a total of 8 free bytes of
oob area. However, the MEMWRITEOOB ioctl still uses OOB_PLACE and not OOB_AUTO so this seems like it would still not work?

If I'm missing something let me know otherwise I'm open for
suggestions.

thanks,
jeff