[Yaffs] When is a block which is marked for retirement actua…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Wagner Scott (ST-IN/ENG1.1)
Date:  
To: yaffs
Subject: [Yaffs] When is a block which is marked for retirement actually marked bad?
Hello all,

I'm writing to ask your help in understanding how and when yaffs marks
blocks bad. (YAFFS 1 mode (small page); recent release.)

Specifically, when writing to an untried chunk (a chunk in a new device
or an erased block), there is a possibility that the write will fail.
In this case, the block is marked as needsRetiring=1 and
yaffs_DeleteChunk() is called, but I do not see (either by code
inspection or by observation of a running system) that the affected
block is marked as bad - at least in the short term. Does garbage
collection do this when it "gets around to it"? If so, when does
garbage collection "get around to it"? Or does something else
physically mark the block bad?

When such a chunk write error occurs, it could be after some number of
good chunks in the erase block have been written. In this case, it
seems that something has to find a new home for these chunks and relink
them before the block is marked bad. How / where is this done?

Finally, my real concern is the case (which I have observed in real
life) where I do lots of writes to a yaffs file system (e.g. untar a
bunch of application software onto a new system) and encounter a bad
write along the way. There is a lot of spewage of the form:
**>> yaffs write required 2 attempts
**>>mtd ecc error fix performed on chunk 84128:0
**>>Block 2629 marked for retirement
**>>mtd ecc error fix performed on chunk 84130:0
**>>Block 2629 marked for retirement
**>>mtd ecc error fix performed on chunk 84136:0
**>>Block 2629 marked for retirement
**>>mtd ecc error fix performed on chunk 84138:0
**>>Block 2629 marked for retirement
**>>mtd ecc error fix performed on chunk 84140:0
**>>Block 2629 marked for retirement
**>>mtd ecc error fix performed on chunk 84144:0
**>>Block 2629 marked for retirement
However, there is no message saying that Block 2629 has been retired.
If I reboot the system at this point, there is also no indication from
either the MTD or yaffs scan that Block 2629 is bad (hence my suspicion
that the actual marking bad is done lazily at some future time.) Is
something going wrong?

Thanks in advance for any clues!

Scott Wagner
Bosch Security Systems, Inc.
Fairport, NY USA