Re: [Yaffs] Yaffs2 erasure issue on MT29 NAND part

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] Yaffs2 erasure issue on MT29 NAND part
On Friday 24 July 2009 03:44:16 Andrew McKay wrote:
<snip>
>
> I'm seeing the garbage collection algorithm cleaning up blocks
> successfully:
>
> yaffs_BlockBecameDirty block 5702 state 5
> Erased block 5702
> yaffs_BlockBecameDirty block 5703 state 8
> Erased block 5703
> yaffs_BlockBecameDirty block 5704 state 8
> Erased block 5704
> yaffs_BlockBecameDirty block 5706 state 8
> Erased block 5706
> yaffs_BlockBecameDirty block 5707 state 8
> Erased block 5707
> yaffs_BlockBecameDirty block 5709 state 5
> Erased block 5709
> yaffs_BlockBecameDirty block 5710 state 8
> Erased block 5710
>
> Now I'll look into marking of bad blocks. Who is responsible for marking
> bad blocks YAFFS or MTD? Or does YAFFS make calls into MTD to mark the
> blocks bad?


Turn on YAFFS_TRACE_MTD

Yaffs calls 
int nandmtd2_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo)
{
    struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
    int retval;
    T(YAFFS_TRACE_MTD,
      (TSTR("nandmtd2_MarkNANDBlockBad %d" TENDSTR), blockNo));


    retval =
        mtd->block_markbad(mtd,
                   blockNo * dev->nChunksPerBlock *
                   dev->totalBytesPerChunk);


    if (retval == 0)
        return YAFFS_OK;
    else
        return YAFFS_FAIL;


}

The actual bad block marking strategy is in mtd. It's done this way because
different lashes have different bad block marking strategies.


>
> > Try doing some nandwrites etc to manually do stuff to the block and see
> > if that works.
>
> How would you recommend doing this? Unmounting the YAFFS2 file system and
> reading and writing the NAND block device directly?

Yes, do some manual operations on an unmounted yaffs partition.

>
> Thanks,
> Andrew
>
>
> _______________________________________________
> yaffs mailing list
>
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs