Hi,
I see some bad block definition issue in YAFFS2.
In the YAFFS2 read function, when a page occur bit flip more 3 times, the block contain this page will be marked as bad block. as below read function:
int yaffs_rd_chunk_tags_nand(struct yaffs_dev *dev, int nand_chunk,
u8 *buffer, struct yaffs_ext_tags *tags)
{
int result;
struct yaffs_ext_tags local_tags;
int flash_chunk = apply_chunk_offset(dev, nand_chunk);
dev->n_page_reads++;
/* If there are no tags provided use local tags. */
if (!tags)
tags = &local_tags;
result = dev->tagger.read_chunk_tags_fn(dev, flash_chunk, buffer, tags);
if (tags && tags->ecc_result > YAFFS_ECC_RESULT_NO_ERROR) {
struct yaffs_block_info *bi;
bi = yaffs_get_block_info(dev,
nand_chunk /
dev->param.chunks_per_block);
yaffs_handle_chunk_error(dev, bi);
}
return result;
}
But actually, in NAND flash, only program and erase error can be marked bad block. Bit flip symptom is easy happen after a page is read many cycles.
If a system use YAFFS2, and never power down this system, user will see a lot of bad block after they run a time, But this block isn’t a real bad block.
How about just refresh the block when bit flip occur, but not record the bit flip count, and mark it as bad block?
Thanks
Best Regards,
Qi Wang 王起
EBU APAC SE
Tel: 86-021-38997158
Mobile: 86-15201958202
Email: qiwang@micron.com
Address: No 601 Fasai Rd, Pudong, Shanghai, China, 200131