[Yaffs] Yaffs/mtd ECC problem: "**>>mtd ecc error"

Claudio Lanconelli lanconelli.claudio at eptar.com
Fri Nov 4 12:11:32 GMT 2005


Hi,
Till last week I used yaffs (old yaffs1 module) without problems on my 
Microblaze board
with uClinux 2.4.31-uc0 and a Samsung K9F5608 standard 32MB Nand flash. 
I wrote my own
driver to interface the nand flash in MTD.

Now I switched to latest CVS yaffs2 (in yaffs1 mode) + latest CVS MTD 
patched for uClinux
2.4.31.
If I configure YAFFS to use its own ECC calculations it seems to work 
fine, but if I try to
use MTD ECC calculations ( #undef CONFIG_YAFFS_DOES_ECC ) a lot of error 
messages appears like
this:
**>>mtd ecc error unfixed on chunk 1:0
**>>mtd ecc error unfixed on chunk 1:1
**>> yaffs: getBlockInfo block 0 is not valid
**>>Block 0 marked for retirement

Here a detailed log of operations. mkyaffs to erase the partition, copy 
a file to it and read it
back. Can you help me understand what is the problem?
I need to use MTD ECC since I'll want to use Hardware ECC to speed up 
read/write operations (this
test use MTD Software ECC routines)

Regards,
Claudio Lanconelli

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000e1000 00001000 "ROMfs"
mtd1: 00400000 00004000 "MBOPB NandFlash partition 1"
mtd2: 00400000 00004000 "MBOPB NandFlash partition 2"
mtd3: 01800000 00004000 "MBOPB NandFlash partition 3"
# mkyaffs -e /dev/mtd2
argc 3 sh 0 optcnt 2
Erasing and programming NAND
Erasing block at 0x080
Erasing block at 0x084000
[...]
Erasing block at 0x083f8000
Erasing block at 0x083fc000
OK
# mount -t yaffs /dev/mtdblock2 /mnt
yaffs: dev is 7938 name is "1f:02"
yaffs: Attempting MTD mount on 31.2, "1f:02"
yaffs: yaffs_GutsInitialise()
yaffs: yaffs_GutsInitialise() done.
# cp /tmp/image.bin /mnt
**>>mtd ecc error unfixed on chunk 0:0
**>>mtd ecc error unfixed on chunk 0:1
**>> yaffs: getBlockInfo block 0 is not valid
**>>Block 0 marked for retirement
# cat /proc/yaffs
YAFFS built:Nov  4 2005 11:37:24
$Id: yaffs_fs.c,v 1.33 2005/10/27 22:24:04 marty Exp $
$Id: yaffs_guts.c,v 1.22 2005/10/13 02:17:00 charles Exp $

Device 0 "MBOPB NandFlash partition 2"
startBlock......... 0
endBlock........... 255
chunkGroupBits..... 0
chunkGroupSize..... 1
nErasedBlocks...... 150
nTnodesCreated..... 300
nFreeTnodes........ 57
nObjectsCreated.... 100
nFreeObjects....... 95
nFreeChunks........ 4830
nPageWrites........ 3364
nPageReads......... 1
nBlockErasures..... 0
nGCCopies.......... 0
garbageCollections. 0
passiveGCs......... 0
nRetriedWrites..... 0
nRetireBlocks...... 0
eccFixed........... 0
eccUnfixed......... 0
tagsEccFixed....... 0
tagsEccUnfixed..... 0
cacheHits.......... 0
nDeletedFiles...... 0
nUnlinkedFiles..... 0
nBackgroudDeletions 0
useNANDECC......... 1
isYaffs2........... 0
# umount /mnt
# mount -t yaffs /dev/mtdblock2 /mnt
yaffs: dev is 7938 name is "1f:02"
yaffs: Attempting MTD mount on 31.2, "1f:02"
yaffs: yaffs_GutsInitialise()
**>>mtd ecc error fix performed on chunk 3362:0
**>>mtd ecc error unfixed on chunk 3362:1
**>>Block 105 marked for retirement
yaffs: yaffs_GutsInitialise() done.

# cp /mnt/image.bin /tmp/_image.bin
**>>mtd ecc error unfixed on chunk 1:0
**>>mtd ecc error unfixed on chunk 1:1
**>> yaffs: getBlockInfo block 0 is not valid
**>>Block 0 marked for retirement
**>>mtd ecc error unfixed on chunk 2:0
**>>mtd ecc error unfixed on chunk 2:1
**>> yaffs: getBlockInfo block 0 is not valid
**>>Block 0 marked for retirement
[...]
**>>mtd ecc error unfixed on chunk 3360:0
**>>mtd ecc error unfixed on chunk 3360:1
**>>Block 105 marked for retirement
**>>mtd ecc error fix performed on chunk 3361:0
**>>mtd ecc error unfixed on chunk 3361:1
**>>Block 105 marked for retirement
# cat /proc/yaffs
YAFFS built:Nov  4 2005 11:37:24
$Id: yaffs_fs.c,v 1.33 2005/10/27 22:24:04 marty Exp $
$Id: yaffs_guts.c,v 1.22 2005/10/13 02:17:00 charles Exp $

Device 0 "MBOPB NandFlash partition 2"
startBlock......... 0
endBlock........... 255
chunkGroupBits..... 0
chunkGroupSize..... 1
nErasedBlocks...... 150
nTnodesCreated..... 300
nFreeTnodes........ 57
nObjectsCreated.... 100
nFreeObjects....... 95
nFreeChunks........ 4830
nPageWrites........ 0
nPageReads......... 6722
nBlockErasures..... 0
nGCCopies.......... 0
garbageCollections. 0
passiveGCs......... 0
nRetriedWrites..... 0
nRetireBlocks...... 0
eccFixed........... 0
eccUnfixed......... 0
tagsEccFixed....... 0
tagsEccUnfixed..... 1
cacheHits.......... 0
nDeletedFiles...... 0
nUnlinkedFiles..... 0
nBackgroudDeletions 0
useNANDECC......... 1
isYaffs2........... 0
# umount /mnt



More information about the yaffs mailing list