Hi Ricky,
Please find attached my latest patch which:
- Adds unclean block (no spare or not sealed) recover, with a new bad
block type - PENDING_BLK_CLEANUP - which behaves like
PENDING_BLK_REFRESH, but won't be overridden by PENDING_BLK_RECOVER.
- Removes uffs_FlashMarkDirtyPage - not needed anymore.
- Adds dev->pending.block_in_recovery safeguard to prevent re-adding
bad block currently in recover procedure.
- Changes page 0 TAG_IS_VALID check to TAG_IS_GOOD in
_BuildValidTreeNode, so blocks with unsealed page 0 will be immediately
erased.
- Adds uffs_FlashOpsSt.CheckErasedBlock to let the driver decide how
and if to check erased blocks.
- Modifies uffs_BlockInfoLoad(UFFS_ALL_PAGES) to not bail out on first
read failure, but continue to the end. Tags that can't be read will be
invalid. This saved uffs a lot of rereads when it hits an error and
performs block recovery.
- Optimizes uffs_FindBestPageInBlock for fully loaded blocks.
- Fixes two cases where bad blocks weren't processed correctly, but
instead erased and subsequently reused.
Regards.