Hi Karl, > In the read and write functions, isn't the "if (dev->useNANDECC)" > unnecessary since the yaffs2 code only supports the MTD ECC? I thought YAFFS2 was also capable of doing its own ECC. Anyway, I was aiming to preserve functionality and only make things work with the curernt MTD stack. > And in the write function, you write the data and tags using separate mtd > calls. This means (at least for normal NAND) that the spare area is written > twice, first with data ecc, and then with tags. Wouldn't something like > this be better, since write_oob() can write both in one go? Note that tags > is never NULL. There definitely is rationale in your words. Though, as far as I thought, tags might be NULL, but anyway tags were never written without writing data. I was trying to do writing both data and tags in one call but I wasn't successful. Later I discovered that the problem was outside YAFFS and submitted the patch fixing it linux-mtd, so now everything is ready to do that in a better way (ie as you propose). > > /* Write data and oob area, or only oob area */ > yaffs_PackTags2 (&pt, tags); > ops.mode = MTD_OOB_AUTO; > ops.oobbuf = (void *)&pt; > ops.ooblen = sizeof(pt); > ops.len = data ? dev->nBytesPerChunk : sizeof(pt); > ops.ooboffs = 0; > ops.datbuf = (uint8_t *)data; > retval = mtd->write_oob (mtd, addr, &ops); Well, a bit differently, but still... please find the updated patch attached. Thanks for feedback! Best regards, Vitaly