From: Adrian Hunter <ext-adrian.hunter@nokia.com>
To: "ext Jörn Engel" <joern@logfs.org>
Cc: linux-mtd@lists.infradead.org, kmpark@infradead.org
Subject: Re: [PATCH] [MTD] [OneNAND] Do not stop reading for ECC errors
Date: Tue, 06 Nov 2007 09:14:21 +0200 [thread overview]
Message-ID: <4730144D.2030604@nokia.com> (raw)
In-Reply-To: <20071105162321.GA21533@lazybastard.org>
ext Jörn Engel wrote:
> On Mon, 5 November 2007 16:46:13 +0200, Adrian Hunter wrote:
>> -EBADMSG is an ECC error.
>>
>> ret must be non-zero to indicate that the bufferram is invalid. Otherwise
>> if we read from the same location again, the data would be taken from
>> bufferram
>> and no ECC error would be reported. However we need to keep reading (see
>> nand_base.c)
>> so ret is set to zero as though no error occured. Finally
>> mtd->ecc_stats.failed
>> is examined to determine ECC errors. i.e.
>
> Hmm.
>
>> static int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
>> size_t *retlen, u_char *buf)
>> {
>> ...
>> stats = mtd->ecc_stats;
>> ...
>> while (!ret) {
>> ...
>> ret = this->wait(mtd, FL_READING);
>> onenand_update_bufferram(mtd, from, !ret);
>> if (ret == -EBADMSG)
>> ret = 0;
>> }
>> *retlen = read;
>> if (mtd->ecc_stats.failed - stats.failed)
>> return -EBADMSG;
>> if (ret)
>> return ret;
>
> Those two conditionals should have reversed order, imo.
Very true. I have added that fix to the patch also - see next mail.
>
>>> What about -EUCLEAN?
>> The wait function doesn't return -EUCLEAN. It increments
>> mtd->ecc_stats.corrected and returns
>> zero for correctable ECC errors.
>>
>> File systems (like say JFFS2 for example) don't expect -EUCLEAN from
>> mtd->read_oob and would treat
>> it as a fatal error, so it must not be returned in this case.
>
> Such an interface sure looks strange. But since read_oob is strange
> anyway I don't care very much either way.
>
> Jörn
>
next prev parent reply other threads:[~2007-11-06 7:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 11:30 [PATCH] [MTD] [OneNAND] Do not stop reading for ECC errors Adrian Hunter
2007-11-05 13:25 ` Jörn Engel
2007-11-05 14:46 ` Adrian Hunter
2007-11-05 16:23 ` Jörn Engel
2007-11-06 7:14 ` Adrian Hunter [this message]
2007-11-06 7:14 ` Adrian Hunter
-- strict thread matches above, loose matches on Subject: below --
2007-11-06 7:17 Adrian Hunter
2007-11-06 8:26 ` Kyungmin Park
2007-11-09 14:21 ` Adrian Hunter
2007-11-15 8:00 ` Adrian Hunter
2007-11-26 11:45 ` Adrian Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4730144D.2030604@nokia.com \
--to=ext-adrian.hunter@nokia.com \
--cc=joern@logfs.org \
--cc=kmpark@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.