* Zeng Xin <
xingogogo@gmail.com> wrote:
> 1. In yaffs_nandif.c, the nandif_ReadChunkWithTagsFromNAND [...]
> My question is how can we evaluate the eccStatus in nand flash
> driver? Do we need calculate ECC of the data every time even if the the
> YAFFS2 only need to read spare area via this interface in the driver?
It's up to the NAND driver to compute and check ECC in some way that
is appropriate for the chip. On some boards the controller has helper
functions which compute the ECC for you; on others you have to do it
all in software.
The non-YDI code always checks the page data ECC, even if the caller
passed in a null pointer for the page data. See nandmtd2_read_chunk_tags
in yaffs_mtdif2_multi.c for how it does this.
> 2. It seems YAFFS2 will search the checkpoint block from the start to the
> end of the flash, if it doesn't exist, the mount procedure will takes much
> more time.
This is correct. A checkpoint holds a snapshot of the YAFFS in-memory
data structures. If there is no valid checkpoint, YAFFS must scan the
entire filesystem to rebuild these data structures before the mount
completes. To avoid having to do this, ensure the filesystem is unmounted
(or is mounted read-only) before powering off.
Ross