[Yaffs] Problems with Refreshing Blocks with ECC Corrections

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Trent Lillehaugen
Date:  
To: yaffs@lists.aleph1.co.uk
Subject: [Yaffs] Problems with Refreshing Blocks with ECC Corrections
I am using YAFFS with the direct interface for an embedded system.

There are two YAFFS partitions:
/image
/data

A typical boot cycle is as follows:
- Bootloader mounts /image as read only
- Bootloader copies executable from /image to RAM
- Bootloader unmounts /image
- Bootloader starts application
- Application mounts /data as read/write
- Application does stuff
- Application unmounts /data
- Application shutsdown system

I would expect YAFFS to refresh blocks in the /image partition that start showing ECC errors that are corrected, but I do not see this occurring.

To test, I modified our NAND driver to inject 1-bit read errors on a specific page. I see that our integration with YAFFS correctly identifies that the page has an ECC correction and that YAFFS marks it for priority garbage collection. To ensure that some garbage collection occurs I am calling 'yaffs_BackgroundGarbageCollect' before unmounting.

Stepping through the 'yaffs_BackgroundGarbageCollect' call I see that the block containing the page with ECC correction is not moved to another block because in 'yaffs_GarbageCollectBlock', 'maxCopies' is set to 5 and in this case more than 5 pages are in use.

I don't see how blocks will ever be refreshed correctly in this scenario.

Are my expectations incorrect?
I am forgetting to call something or calling something incorrectly?
Is there any way (without modifying the YAFFS code) to force refreshes even on a heavily used block?

Thanks,

Trent

This e-mail is the property of RED Digital Cinema Camera Company. It is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential, or otherwise protected from disclosure. Distribution or copying of this e-mail, or the information contained herein, to anyone other than the intended recipient is prohibited.