[Yaffs] Handling of EUCLEAN error from MTD

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Chris Paulson-Ellis
Date:  
To: yaffs
Subject: [Yaffs] Handling of EUCLEAN error from MTD
Hi,

I've been looking at how yaffs2 interacts with the Linux MTD layer with
a view to implementing my own interface layer for a yaffs-direct based
bootloader I'm writing.

I noticed that if the MTD layer finds and corrects ECC errors, then
nand_read will return -EUCLEAN rather than 0. Yaffs doesn't seem to
recognise this return code as "we had some problems, but fixed them", so
will regard these reads as failures. This will cause the block to be
prematurely marked bad.

My flash device data sheet suggests that this scenario is likely enough
to happen that the system should not mark blocks bad in this case.

Is my analysis wrong? Is there some reason why I shouldn't allow a
"corrected read" to be a successful read in my bootloader's nand
interface layer?

Regards,
Chris.