Tag ECC calculated, but not used with UFFS_ECC_HW*

50 views
Skip to first unread message

Savin Zlobec

unread,
Oct 24, 2013, 3:39:02 PM10/24/13
to UFFS
Hi Ricky,

I have a case where I would like to recover as much data as possible
if I get ECC failure from my HW. The problem is that if the flash
driver returns ECC_FAIL or BAD_BLK in uffs_FlashReadPageTag the SW
calculated Tag ECC is not checked and no verification/correction is
attempted. So even if the ECC failure is located somewhere in data
UFFS automatically treats its tag as invalid - uffs_FlashReadPageTag
returns ECC_FAIL or BAD_BLK and uffs_BlockInfoLoad sets the Tag invalid
bit.

Block recovery will stop at the failed page, because FindPageInBlock
methods check the Tag valid bit and return UFFS_INVALID_PAGE if set.

Please find attached a patch which tries to remedy that. Although it
will work correctly only if CONFIG_UFFS_REFRESH_BLOCK is enabled, since
the patch modifies uffs_FlashReadPageTag to override HW ECC_FAIL/BAD_BLK
- if Tag was OK or corrected - with ECC_OK. This will trigger block
refresh and subsequently block recover. uffs_FlashReadPageTag could
use more verbose error codes or a flag to indicate to upper layer
that Tag was OK, but block is bad and needs to be recovered.

Regards.
block_recover.patch
Reply all
Reply to author
Forward
0 new messages