Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628969
| From | Pavel Machek <pavel@ucw.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | tango_nand: is logic right in error cases? (was Re: fsl_ifc_nand: are blank pages protected by ECC?) |
| Date | 2017-04-23 12:00 +0200 |
| Message-ID | <tzmtb-6QE-11@gated-at.bofh.it> (permalink) |
| References | <txWKu-3m5-21@gated-at.bofh.it> <ty5b4-8qb-19@gated-at.bofh.it> <tyDFL-4xX-7@gated-at.bofh.it> <tyGWZ-6mH-3@gated-at.bofh.it> <tyH6G-6q7-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
Hi!
> > Maybe I figured it out. Unfortunately, it is only compile tested. Does
> > it look approximately right?
>
> Yep that's definitely better. Just one thing missing (see below),
> otherwise it looks good.
I'm copying from tango_nand, therefore I had to check tango_nand, too.
static int check_erased_page(struct nand_chip *chip, u8 *buf)
{
...
res = nand_check_erased_ecc_chunk(buf, pkt_size, ecc, ecc_size,
meta, meta_len,
chip->ecc.strength);
if (res < 0)
mtd->ecc_stats.failed++;
else
mtd->ecc_stats.corrected += res;
bitflips = max(res, bitflips);
...
return bitflips;
}
static int tango_read_page(struct mtd_info *mtd, struct nand_chip *chip,
u8 *buf, int oob_required, int page)
{
...
res = decode_error_report(nfc);
if (res < 0) {
chip->ecc.read_oob_raw(mtd, chip, page);
res = check_erased_page(chip, buf);
}
return res;
}
So nand_check_erased_ecc_chunk() returns < 0 (failed ECC), but then we
perform max() with bitflips (lets say 1, correctable ECC) and return
1? tango_read_page then returns 1 (correctable ECC) forgetting about
failed ECC...?
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
fsl_ifc_nand: are blank pages protected by ECC? Pavel Machek <pavel@ucw.cz> - 2017-04-19 14:20 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-04-19 23:20 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Pavel Machek <pavel@ucw.cz> - 2017-04-20 00:20 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-04-20 00:30 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Pavel Machek <pavel@ucw.cz> - 2017-04-20 13:50 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-04-20 14:20 +0200
[PATCH] nand_base: optimize checking of erased buffers Pavel Machek <pavel@ucw.cz> - 2017-04-21 13:00 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Pavel Machek <pavel@ucw.cz> - 2017-04-21 12:10 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Richard Weinberger <richard@nod.at> - 2017-04-21 12:20 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-04-21 14:10 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Pavel Machek <pavel@ucw.cz> - 2017-04-21 15:40 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-04-21 15:50 +0200
Re: fsl_ifc_nand: are blank pages protected by ECC? Pavel Machek <pavel@ucw.cz> - 2017-04-22 09:10 +0200
[PATCH] tango_nand.c: fix ecc.stats_corrected in empty flash case Pavel Machek <pavel@ucw.cz> - 2017-04-22 12:50 +0200
tango_nand: is logic right in error cases? (was Re: fsl_ifc_nand: are blank pages protected by ECC?) Pavel Machek <pavel@ucw.cz> - 2017-04-23 12:00 +0200
Re: tango_nand: is logic right in error cases? (was Re: fsl_ifc_nand: are blank pages protected by ECC?) Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-04-24 09:20 +0200
csiph-web