yaffs2 and nand_write_ecc problem

ken HP kenhp1982 at gmail.com
Tue Jul 18 02:11:31 EDT 2006


hello everyone

I use yaffs2 on samsung nand flash(2k page 512M) now. I download
latest mtd CVS from ftp://ftp.uk.linux.org/pub/people/dwmw2/mtd/cvs/
when I umount and remount,  file disappear.I knew about the interface
between yaffs2 and mtd have some problem.but in my yaffs2 source code
this problem seems just fixed.yaffs2 put and read tags just in 2-38
field of oob.

I traced the code and found problem is here. in nand_base.c. I found
that if I use option NAND_ECC_NONE, the function nand_write_ecc would
not read any oob data. However,in yaffs2 side, it suppose
mtd->write_ecc will write data and tags.

code is here

$Id: nand_base.c,v 1.166 2006/03/13 06:09:08 vwool Exp $

 static int nand_write_page (struct mtd_info *mtd, struct
 nand_chip *this, int page,u_char *oob_buf,  struct nand_oobinfo
*oobsel, int cached)
 {
 ......

 switch (eccmode) {
 /* No ecc, write all */
 case NAND_ECC_NONE:
  printk (KERN_WARNING "Writing data without ECC to   NAND-FLASH is
not recommended\n");
  this->write_buf(mtd, this->data_poi, mtd->oobblock);
  break;

nand_write_ecc calls nand_write_page, but if the option is
NAND_ECC_NONE, it just simple writes 2048 byte data, break and return.
so yaffs2'tag is not written to oob.

I change nand_base.c to previous one whose nand_write_page will write
oob, and yaffs2 works perfectly.

Does anyone have the same problem ? and Does this problem(
nand_write_page do not write data to oob with option NAND_ECC_NONE) is
a bug?

apologize for my poor english.




More information about the linux-mtd mailing list