[PATCH] MTD: make s3c2410's correct_data indicate an error for multi-bit read errors
Matt Reimer
mattjreimer at gmail.com
Fri Oct 19 15:29:45 EDT 2007
On 10/19/07, Artem Bityutskiy <dedekind at infradead.org> wrote:
> On Fri, 2007-10-19 at 10:24 +0200, Jörn Engel wrote:
> > > @@ -397,7 +397,7 @@ static int s3c2410_nand_correct_data(struct
> > > mtd_info *mtd, u_char *dat,
> > > if ((diff0 & ~(1<<fls(diff0))) == 0)
> > > return 1;
> > >
> > > - return 0;
> > > + return -1;
> > > }
>
> Yup, Jörn is right, you should return -EBADMSG on ECC errors and
> -EUCLEAN if there was a correctable bit-flip.
See the patch I posted a couple of days ago with the subject "MTD:
treat any negative return value from correct() as an error". Once that
patch is accepted, doing what you say will work as you expect; right
now, it results in lying to upper layers about errors.
Matt
More information about the linux-mtd
mailing list