[PATCH] mtd: nand: handle ECC errors in OOB

Artem Bityutskiy dedekind1 at gmail.com
Mon Jun 27 15:10:43 EDT 2011


On Thu, 2011-06-23 at 16:45 -0700, Brian Norris wrote:
> While the standard NAND OOB functions do not do ECC on the spare area,
> it is possible for a driver to supply its own OOB ECC functions (e.g., HW
> ECC). nand_do_read_oob should act like nand_do_read_ops in checking the
> ECC stats and returning -EBADMSG or -EUCLEAN on uncorrectable errors or
> correctable bitflips, respectively. These error codes could be used in
> flash-based BBT code or in YAFFS, for example.
> 
> Doing this, however, messes with the behavior of mtd_do_readoob. Now,
> mtd_do_readoob should check whether we had -EUCLEAN or -EBADMSG errors
> and discard those as "non-fatal" so that the ioctls can still succeed
> with (possibly uncorrected) data.
> 
> Signed-off-by: Brian Norris <computersforpeace at gmail.com>
> ---
>  drivers/mtd/mtdchar.c        |   15 +++++++++++++++
>  drivers/mtd/nand/nand_base.c |    9 ++++++++-
>  2 files changed, 23 insertions(+), 1 deletions(-)

Looks good, pushed to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list