Hi, Yaffs friends
I have one question about yaffs_handleChunkError function calling code logic.
In yaffs_ReadChunkWithTagsFromNAND:
if (tags &&
tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR) {
yaffs_BlockInfo *bi;
bi = yaffs_GetBlockInfo(dev, chunkInNAND/dev->param.nChunksPerBlock);
yaffs_HandleChunkError(dev, bi);
}
Why use “tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR “ instead of “tags->eccResult > YAFFS_ECC_RESULT_FIXED” ?
If the flash has some one bit errors and these errors are corrected, Tags->eccResult will be set to YAFFS_ECC_RESULT_FIXED. in this condition, there should be no ecc problem.
Why need to call yaffs_HandleChunkError ?
The problem is : if call yaffs_HandleChunkError, bi->chunkErrorStrikes++ will be executed. After chunkErrorStrikes > 3, the block will be retired. It will be marked as bad. But the block is not really bad. We can still use it since it only has 4 times of fixed ECC error happened.
thanks
Xiaoguang