Re: [Yaffs] [PATCH] [YAFFS] YAFFS2: Add comments for maintai…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ian McDonnell
Date:  
To: rick
CC: yaffs
Subject: Re: [Yaffs] [PATCH] [YAFFS] YAFFS2: Add comments for maintaining backward compatibility.
Rick,

On Thursday 06 September 2007 17:55, Rick Bronson wrote:
> > On Thursday 06 September 2007 14:30, Rick Bronson wrote:
> > > + *
> > > + * If you need to maintain different OOB layouts on jffs2 vs yaffs on the
> > > + * same NAND part then you will need to set chip->ecc.layout on entry to
> > > + * the following routines: nand_read, nand_read_oob, nand_write,
> > > + * nand_write_oob, nand_erase_nand, nand_block_markbad. You also need
> > > + * to set parts->ecclayout for the separate partitions, probably in your
> > > + * NAND probe routine.
> >
> > Using different layouts for different partitions of a device is
> > not something that comes easy to MTD. The layout being part of
> > the nand_chip object (single instance) rather that the mtd_partition
> > object. So I'm not sure I follow what you mean when you say "need to set
> > chip->ecc.layout on entry" -- do you mean make changes to nand_base.c
> > to support multiple (runtime) layouts? If so, there's quite a bit
> > more to this, isn't there?
> >
>
> We needed to maintain backward compatibilty with 2.4 which,
> unfortunately, used jffs2 on one partition and old yaffs on 4 other
> partitions. jffs2 and the old yaffs had different OOB layouts. As
> far as my limited testing goes it seems to work fine with the changes
> outlined above. If you know of a better way, I'd love to hear it.
>


I don't. Do you have a patch that has a chance of being accepted for MTD?
Without the change to MTD, I fear that adding this comment may set
expectations that achieving per-partition layout policies is
easier than it really is. It requires modifications to core MTD code
and supporting this is really not for Yaffs, more MTD. Do you agree.

I'd like to see "per-partition layout policies" supported by MTD.

> > >   */
> > >  static struct nand_ecclayout nand_oob_16 = {
> > >      .eccbytes = 6,
> > >      .eccpos = { 8, 9, 10, 13, 14, 15 },
> > > +#ifdef CONFIG_YAFFS_9BYTE_TAGS
> > >      .oobavail = 9,
> > >      .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
> > > +#else
> > > +    .oobavail = 8,
> > > +    .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 } }
> > > +#endif
> > >  };
> > >  #endif

> >
> > This ifdef only works if Yaffs config is part of the kernel build
> > because the file containing this data definition would normally be
> > in the (static) kernel or platform module -- not in Yaffs code.
>
> In my case it's part of the kernel build so it works fine. I would
> still keep the #ifdef as above because it lets people know that there
> are two distinct layouts here. It wasn't totally obvious to me when I
> first encountered this comment.


Okay, I see.

-imcd