[Yaffs] General debugging notes

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
New-Topics: [Yaffs] NAND flash controller computing ecc on main and spare together
Subject: [Yaffs] General debugging notes
Hi All

There seem to be a few people having issues at the moment and I'd like to
present a few hints and tips for debugging that might help to isolate
problems.

While I make no claims that yaffs is perfect, most problems are related to
flash driver issues. The most common one is that ECC and bad block marking
etc and the yaffs tags stomp on eachother, causing byte corruption.

If you're using Linux, then the VFS masks quite a few problems because a write
to a file and immediate read back will be serviced by the VFS cache so
corruptions won't be immediately obvious. Same too for checkpointing.
Disabling checkpointing makes problems more obvious sooner.

0) Turn on all debugging and simplify
You can turn on yaffs tracing by either hacking the yaffs_traceMask variable
or at runtime through
echo "+a'll" >/proc/yaffs
Turn on all mtd debugging too.
Turn on all debugging in the yaffs Kconfig too.
Read debug stats in /proc/yaffs
Look in lost+found after a reboot to see if there are odd files there?

Disable checkpointing.

1) Start small
Begin with an erased flash (flash_eraseall etc). Mount yaffs partition.
check /proc/yaffs, write a few small files, check /proc/yaffs and do a
reboot.

Remount the yaffs partition. Are the files there? Are there bad blocks? Are
there files in lost+found?

Starting small allows the problems to be isolated. The above should not have
to do any garbage collection, erasing etc.

Until that works there's no point in going further.

2) Start testing garbage collection and erasing
Write a few largish files (say a couple of MB each) then delete them and write
more.
Look at /proc/yaffs. Do you see bad blocks etc?
Reboot. Are there bad blocks etc? Are there files in lost+found?

3) More serious testing
Fill the file system, delete some files and fill again. Reboot. Remount. Are
the files all good?



Hope that helps a bit

-- Charles