oobavail issues
Joshua Wise
joshua at joshuawise.com
Wed Mar 30 20:18:50 EST 2005
Hi folks,
We're debugging a mysterious crash on NAND writes on an s3c2410-derived
driver. The culprit seems to be in how oobavail is determined:
line 2524 nand_base.c: mtd->oobavail = mtd->oobsize -
(this->autooob->eccbytes + 1);
Our oobinfo is the same as the s3c2410's. For reference, that's:
static struct nand_oobinfo nand_hw_eccoob = {
.useecc = MTD_NANDECC_AUTOPLACE,
.eccbytes = 3,
.eccpos = {0, 1, 2 },
.oobfree = { {8, 8} }
};
We found that making our oobfree match up with oobavail seemed to do the
trick for avoiding this, and make JFFS2 work, to boot! Here's what we did:
static struct nand_oobinfo nand_hw_eccoob = {
.useecc = MTD_NANDECC_AUTOPLACE,
.eccbytes = 3,
.eccpos = {0, 1, 2 },
.oobfree = { {8, 8}, {3, 2}, {6, 2} } /* {6, 10} instead? */
};
I suspect that oobavail should be summing oobfree instead of doing that
arithmetic. Or is there something I'm not seeing?
joshua
More information about the linux-mtd
mailing list