OK, I think this is indeed the problem.
The oob scheme declared only 4 bytes of oobfree space.
After some changes and testing using the mtd provided oob test I managed
to find some more unused bytes and now I have 15.
Now yaffs doesn't retire all blocks as before but actually can create
files on the partition. The problem is that after un-mounting and then
re-mounting the partition again file sizes are changing, I guess because
of that missing byte for the tags.
Is there some way I can make yaffs work with only 15 bytes free in the
oob area?
On Wed, 2011-01-19 at 13:49 +1300, Charles Manning wrote:
> On Tuesday 18 January 2011 22:36:40 Boaz Ben-David wrote:
> > To sum it up, my controller (iMX353) uses HW ECC by default, and I am
> > using MLC nand with 4k page and 218B oob.
> > My question is, is it at all possible to make this work with YAFFS using
> > oob tags (as opposed to inband-tags that work) or am I not in the right
> > direction.
>
> You need at least 16 bytes of unused OOB to store tags (this could be reduced
> to approx 12 bytes or so with some effort). If there is less than that then
> you will need to use inband tags.
>
> > YAFFS gives very good performance using the inband-tags option on our
> > device, the only issue is that the partition I am using it on is of
> > 1.6GB size and when recovering from an unclean shutdown with the
> > partition having about 600MB on it, it takes 2:30 minutes to mount
> > and thats far too long.
> >
> > So again, I apologize for asking this again and again but I haven't
> > found any information confirming/dis-confirming that I can make HW ECC
> > and oob
> > tags work on our MLC nand.
>
> It is not so much a matter of HW or SW ECC, but how much space is unused.
> Some HW ECC schemes will leave enough unused OOB for tags and some will not.
>
> >
> > Thanks,
> >
> > Boaz.
> >
> > On Mon, 2011-01-17 at 23:50 +0200, Boaz Ben-David wrote:
> > > From looking at the ecclayout on mxc_nd2.c there are only 4 bytes in the
> > > oobfree member. How many bytes does yaffs need to store it's tags? Also,
> > > the imx35 uses hw ecc, I've read that mlc nand+hw ecc usually means one
> > > cannot really use the oob for anything else, is that true?
> > >
> > > Boaz Ben-David <boaz.bd@wellsense-tech.com> wrote:
> > >
> > >
> > > I'm using freescale's iMX353 and the nand is Samsung 2GB MLC 4k page with
> > > 218 bytes oob. I was somehow under the impression that writing to the oob
> > > area in MLC nand is problematic and thats why I tried using the inband
> > > tags option. Isn't it?
> > >
> > > Charles Manning <manningc2@actrix.gen.nz> wrote:
> > >
> > > On Friday 14 January 2011 10:59:03 Ross Younger wrote:
> > > > On 13/01/11 17:35, Boaz Ben-David wrote:
> > > > > Well, thanks for everyone for their support.
> > > > > It turns out that all I had to do is mount the partitions with the -o
> > > > > inband-tags flag for YAFFS2 to work correctly on my NAND.
> > > >
> > > > Good to hear you've got it working. However, inband tags reduce both
> > > > the storage capacity of the NAND[0] and the performance you can
> > > > achieve[1]. I would recommend regular - out-of-band - tags if possible.
> > > >
> > > > [0] by the size of the packed tags struct (16 bytes) per page; about
> > > > 0.8% of a device with 2k pages.
> > > >
> > > > [1] in cases where YAFFS wants to read only the tags of a page, inband
> > > > mode has to read in the entire page and throw away all but the last 16
> > > > bytes. This adds up fast when mounting following an unclean shutdown,
> > > > when YAFFS has to scan the entire NAND.
> > >
> > > Yes, use out of band tags if you can. Inband tags will generally work
> > > even if the mtd driver's oob handling is broken so you're sidestepping
> > > the issue rather than fixing it.
> > >
> > > What NAND and NAND controller are you using?
> > >
> > > -- CHarles
> > >
> > > _______________________________________________
> > > yaffs mailing list
> > > yaffs@lists.aleph1.co.uk
> > > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
> >
> > _______________________________________________
> > yaffs mailing list
> > yaffs@lists.aleph1.co.uk
> > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>
>