Jordon Wills,
We too faced similar issues with data getting zeroed in the first two
pages of a block following a bad block.
Below is our analysis:
The problem was the OOB length YAFFS2 was reading from MTD. On OneNand
there was 20 bytes left free on OOB and YAFFS2 would request a read of
28 bytes of OOB. The OneNand MTD driver would read 20 bytes from the
page requested and the rest 8 bytes from next page. If the next page
happened to be marked bad we would get an ECC error which would cause
the current page to be ignored as well. Hence the YAFFS2 mounted file
would get corrupted (if this happens to be some of the core android
jar files then it would result in android boot being stuck).
The latest YAFFS2 code ignores reading the ecc portion of the struct (12
bytes) from OOB.(YAFFS2 any way does not calculate the ECC and is handled
by the MTD driver). This way we only read 16 bytes from OOB which is
less than oobavail and hence fixes the issue.
Hope this helps you.
Regards,
Sudeep