Hi guys,
I'm testing a vendors nand driver using yaffs with inband tags
enabled. I was surprised to discover that yaffs doesn't mark blocks
which consistently fail to read with unrecoverable ECC errors as bad.
On closer inspection, I see that yaffs would mark these blocks as bad,
if I were not using inband tags. The following code from
yaffs_mtdif2.c seems to be to be behind this behaviour (I'm using
1006cb3, but this is present at the HEAD of master as well);
if (tags && retval == -EBADMSG && tags->ecc_result ==
YAFFS_ECC_RESULT_NO_ERROR) {
tags->ecc_result = YAFFS_ECC_RESULT_UNFIXED;
dev->n_ecc_unfixed++;
}
if(tags && retval == -EUCLEAN && tags->ecc_result ==
YAFFS_ECC_RESULT_NO_ERROR) {
tags->ecc_result = YAFFS_ECC_RESULT_FIXED;
dev->n_ecc_fixed++;
}
When using inband tags, tags->ecc_result is never assigned to, hence
it's always YAFFS_ECC_RESULT_UNKNOWN, and so n_ecc_unfixed and
n_ecc_fixed are never incremented.
If there some reason things are implemented this way? I see someone
else came across this a couple of years back, but there were no
replies to his message -
http://www.aleph1.co.uk/lurker/message/20120716.182456.29a5ea4f.en.html
Regards,
Dunk