[Yaffs] cvs YAFFS + MTD cvs + 2.4.27-vrs1 problems

Charles Manning manningc2@actrix.gen.nz
Fri, 10 Dec 2004 13:32:53 +1300


On Friday 10 December 2004 11:55, Thomas Gleixner wrote:
> On Thu, 2004-12-09 at 21:10 +0000, Nick Bane wrote:
> > That is precisely what I do and I comment out the MTD whinge.
> > It is clearly important that SOMEONE does the ECC and it is a
> > mild pity that the MTD layer assumes that only it is competant to do =
so.
>
> It's not a pity. It's correct. If you do software ECC, fine. If you hav=
e
> hardware ECC then it _CAN_ only be done in the MTD layer. The filesyste=
m
> layer does not know anything about the available hardware. So it makes
> totaly sense that ECC is done in the MTD/NAND layer and nowhere else.
>
> A filesystem is a filesystem and is not competent to fiddle around with
> hardware. I know that there are OS targets for YAFFS where YAFFS has to
> do everything, but MTD does it the right way.

I might argue the latter point here. I believe the ECC byte ordering=20
calculated by SJHill's nand_ecc.c is wrong.   yaffs_ecc.c can calculate t=
his=20
ECC order or the SmartMedia "correct" order.  yaffs_ecc.c is also slightl=
y=20
faster than nand_ecc.c ;-).

I don't think I have a gripe with the ECC stuff, it's the write verificat=
ion=20
that gets me.

>
> > It is probably that yaffs should get the MTD layer to do its ecc
> > eventually as standard.
>
> Can you please explain this statement to somebody who's native language
> is German ?
>
> What do you mean ?
> Fix YAFFS or hack MTD ?

>From my understanding this is only a configuration issue.

YAFFS can be build with CONFIG_YAFFS_USE_NAND_ECC which means yaffs won't=
 do=20
ECC - it lets mtd do all ECC. This is, IMHO, the best way to do things wi=
th=20
Linux - particularly if there are other non-yaffs users of the NAND.

With non-Linux usage, I recommend using yaffs_ecc.c if software ECC is=20
required.

Where things do break down a bit is with mkyaffs which does calculate ECC=
.=20
You need to be careful to use a consistent ECC strategy.