<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I refer to the nand driver code in the
git and wishes to report some bugs.</font>
<br>
<br><font size=2 face="sans-serif">1) nand erase <start> <end></font>
<br><font size=2 face="sans-serif">The erase operation terminates if a
bad block is encountered. It should be </font>
<br>
<br><font size=2 face="sans-serif">int nand_erase_nand (struct mtd_info
*mtd, struct erase_info *instr, int allowbbt)</font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif">....</font>
<br><font size=2 face="sans-serif"> while
(len) {</font>
<br><font size=2 face="sans-serif">#ifndef NAND_ALLOW_ERASE_ALL</font>
<br><font size=2 face="sans-serif">
/* Check if we have a bad block, we do not
erase bad blocks ! */</font>
<br><font size=2 face="sans-serif">
if (nand_block_checkbad(mtd, ((loff_t) page)
<< this->page_shift, 0, allowbbt)) {</font>
<br><font size=2 face="sans-serif">#if 0</font>
<br><font size=2 face="sans-serif">
printk
(KERN_WARNING "nand_erase: attempt to erase a bad block at address
0x%08x\n", page * mtd->oobblock);</font>
<br><font size=2 face="sans-serif">
instr->state
= MTD_ERASE_FAILED;</font>
<br><font size=2 face="sans-serif">
goto erase_exit;</font>
<br><font size=2 face="sans-serif">#else</font>
<br><font size=2 face="sans-serif">
/* bad
block; ignore */</font>
<br><font size=2 face="sans-serif">
page +=
pages_per_block;</font>
<br><font size=2 face="sans-serif">
len -=
(1 << this->phys_erase_shift);</font>
<br><font size=2 face="sans-serif">
continue;</font>
<br><font size=2 face="sans-serif">#endif</font>
<br><font size=2 face="sans-serif">
}</font>
<br><font size=2 face="sans-serif">#endif</font>
<br>
<br><font size=2 face="sans-serif">2) nand_write_ecc and/or nand_write_page
writes to the nand flash without checking if the block is bad. I believe
that in the linux kernel, this checking is taken care of in the fs layer
(jffs2/yaffs).</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br><font size=2 face="sans-serif">Terence.</font>