nftl module problem

柳振中 liuzz1983 at gmail.com
Thu Oct 9 14:49:14 EDT 2008


hello
    this is my first time to post email to this  list ,if I do not
follow the rules,I am sorry
    recently,I tried the nftl module in MTD,I found it could not work
well, so I debug it , and found one place that I thought it was the
wrong place.

     in the nftlcore.c file ,line 178 to 198 ,the function nftl_write
,as follows:

-- static int nftl_write(struct mtd_info *mtd, loff_t offs, size_t len,
		   --   size_t *retlen, uint8_t *buf, uint8_t *oob)
--{
	--struct mtd_oob_ops ops;
	--int res;

	--ops.mode = MTD_OOB_PLACE;

	--ops.ooboffs = offs;------------------------------------this place
,I thought i should be 0 ,or offs&(mtd->writesize-1), if the value is
offs, it will be over, and cannot work


	--ops.ooblen = mtd->oobsize;
	--ops.oobbuf = oob;
	--ops.datbuf = buf;
	--ops.len = len;

	--res = mtd->write_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
	--*retlen = ops.retlen;
	--return res;
--}

  I debug it on nandsim (I made a little change on nftl to let it work
on nandsim,just change the nftl_add_mtd function, let it can
recongnize nandsim)
  I change ops.ooboffs=offs into ops.oobffs=0, it can work ;

 anyone could give me an answer whether my change is right?



More information about the linux-mtd mailing list