what cause :**>> yaffs chunk 38598 was not erased

liu.yaojin at zte.com.cn liu.yaojin at zte.com.cn
Wed Jul 29 22:10:11 EDT 2009


hi charles:

i use ecc soft on mtd ,and not select yaffs's own ecc:

* yaffs2 file system support
-*- 512 byte/ page device
[] use older-style...
[] let yaffs do its ecc
-*- 2048 byte...
[*] autoselect yaffs2 format
[] disable lazy..
[] turn off wide tnodes
[] force chunk erase check
[*] cache short name in RAM

this morning i uncheck "[] turn off wide tnodes "and"[] force chunk erase 
check",but it appears again.
BTW, i write the image through uboot(BECAUSE HAVE NOT NETWORK...).and make 
some change on mkyaffsimage:

static int write_chunk(__u8 *data, __u32 objId, __u32 chunkId, __u32 
nBytes)
{
#ifdef OLD_WRITE_METHOD
        yaffs_Tags t;
        yaffs_Spare s;

        error = write(outFile,data,512);
        if(error < 0) return error;

        memset(&t,0xff,sizeof (yaffs_Tags));
        memset(&s,0xff,sizeof (yaffs_Spare));
 
        t.chunkId = chunkId;
        t.serialNumber = 0;
        t.byteCountLSB = nBytes;
        t.objectId = objId;

    if (convert_endian)
    {
        little_to_big_endian(&t);
    }
 
        yaffs_CalcTagsECC(&t);
        yaffs_LoadTagsIntoSpare(&s,&t);
        yaffs_CalcECC(data,&s);
 
        nPages++;
 
        return write(outFile,&s,sizeof(yaffs_Spare));
#else
        yaffs_PackedTags1 pt1;  //new yaffs's tag,not yaffs_Spare
        yaffs_ExtendedTags etags;
        __u8 oobdata[16];
        //
        error = write(outFile,data,512);
        if(error < 0) return error;

        //memset(&t,0xff,sizeof (yaffs_Tags));
        //memset(&s,0xff,sizeof (yaffs_Spare));
        //set tag
        etags.chunkId = chunkId;
        etags.serialNumber = 0;
        etags.byteCount = nBytes;
        etags.objectId = objId;
        etags.chunkDeleted = 0; // let pt1->chunkDetected=0
 
        //yaffs_ExtendedTags changeto yaffs_PackedTags1
        yaffs_PackTags1(&pt1,&etags);
        //calc ecc
        yaffs_CalcTagsECC((yaffs_Tags*)&pt1);
        ((__u8*)&pt1)[8]  = 0xff;
        memset(oobdata,0xff,16);
        //place 8 byte ecc to oob[8]-[15]
        memcpy(oobdata+8,&pt1,8); 
 
        nPages++;
 
        return write(outFile,oobdata,16);
#endif
 
}
----------
in uboot i write full page data(512 data+16 oob) with the image to the 
flash.

Is there some problem?
thanks.

=============================================end 
=================================




Charles Manning <manningc2 at actrix.gen.nz> 
发件人:  linux-mtd-bounces at lists.infradead.org
2009-07-30 06:30

收件人
linux-mtd at lists.infradead.org
抄送
liu.yaojin at zte.com.cn
主题
Re: what cause :**>> yaffs chunk 38598 was not erased






On Wednesday 29 July 2009 21:30:50 liu.yaojin at zte.com.cn wrote:
> hi guys:
>
> i use lastest yaffs filesystem,kernel is 2.6.24.
> my nand flash controller is a little slow.and when i copy(or ls)
> files(more than 1MB?),the console appears:
>
> **>> yaffs chunk 38598 was not erased
> **>> yaffs write required 2 attempts
> page 38598 in gc has no object: 0 0 0
>
> and etc...
> so why this happens continually ?
>

You're probably better off asking yaffs questions on the yaffs list: 
http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs

This is happening because your spare area management is not correct and 
the 
tags are being messed up. Thiis causes yaffs to think that a page of flash 
is 
empty, but it is not.

-- Charles


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/





--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. Any views expressed in this message are those of the individual sender.
This message has been scanned for viruses and Spam by ZTE Anti-Spam system.


More information about the linux-mtd mailing list