On Thu, 2006-02-09 at 23:13 +0000, Sergei Sharonov wrote: > Hi, > > > > > How YAFFS and YAFFS2 behave? > > > > YAFFS is being more cautious than that, which means that in theory YAFFS will > > lose blocks faster than they recommend. However from accelerated lifetime > > testing I've done, I have not seen this to be a practical problem since ECC > > errors are so rare once the problematic blocks have been removed. > > There is another aspect to that - I've seen yaffs1 leak blocks under power > cycling conditions. I suspect power failures were producing incomplete > write/erase cycles and ecc errors as a consequence. That led to retirement of > good blocks that had bad luck to be written to during power down. > > I would be interested to know if anybody else has seen this behavior. Yes, I have. I use a YAFFS1 NOR-based system, and in the writes, we lay down the data chunk, and then the tag. In the unlikely event that a power-cycle occurs while writing the data, the tag is still empty, but some of the data chunk is not erased, and then next time a write occurs into that chunk, YAFFS sees that the write fails since the previous data was written(and retires the whole block), even though the tag indicated the chunk is empty. To fix this, I used two bits in the pageStatus byte in the tag, and write the tag first, then the data, and then update the tag. Assuming that the pageStatus starts out as 0xff, then the first tag write puts in the value of the tag, but writes a pageStatus byte of 0xfe to indicate that a write is in progress, then writes the chunk data, and then comes back an re-writes the tag with the same data, and a pageStatus of 0xfc. In the rest of the code, the chunk is assumed to be valid if the pageStatus is 0xff(and objectId is non-0xfffff) or if 0xfc, empty if the objectId is 0xfffff, and deleted if the pageStatus is either 0xfe, or 0x00(the value written to delete a tag). This solved the problem for me. I assume an approach like this would work for NAND... > Sergei > > > > > _______________________________________________ > yaffs mailing list > yaffs@stoneboat.aleph1.co.uk > http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs