From: Brian Norris <computersforpeace@gmail.com>
To: Zhou Wang <wangzhou.bry@gmail.com>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
Iwo Mergler <Iwo.Mergler@netcommwireless.com>,
pawel.moll@arm.com, ijc+devicetree@hellion.org.uk,
liguozhu@hisilicon.com, haojian.zhuang@gmail.com,
wangzhou1@hisilicon.com, robh+dt@kernel.org,
linux-mtd@lists.infradead.org, xuwei5@hisilicon.com,
galak@codeaurora.org, caizhiyong@huawei.com,
yubingxu@hisilicon.com, David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v4 0/2] mtd: hisilicon: add a new driver for NAND controller of hisilicon hip04 Soc
Date: Mon, 12 Jan 2015 20:17:01 -0800 [thread overview]
Message-ID: <20150113041701.GM9759@ld-irv-0074> (raw)
In-Reply-To: <5491638B.5090403@gmail.com>
Following up on this last comment from last year's thread:
On Wed, Dec 17, 2014 at 07:05:47PM +0800, Zhou Wang wrote:
> On 2014年12月17日 14:23, Brian Norris wrote:
[...]
> >>[ 104.648056] mtd_nandbiterrs: ECC failure, read data is incorrect
> >>despite read success
> >>insmod: can't insert 'mtd_nandbiterrs.ko': Input/output error
> >>
> >>The reason for above failure is that:
> >>In ECC mode, when rewriting page data to NAND flash, the NAND
> >>controller will also produce ECC code and write them to NAND flash
> >>as well. So when we read data from NAND flash, there is no need to
> >>correct the error bit. We read what we write to the flash.
> >
> >BTW, your explanation doesn't seem quite right. The problem is that
> >even though mtd_read() didn't report errors, the data doesn't match
> >what's written. It's not that there was "no need to correct the error
> >bit".
>
> Maybe I did not express clearly. In the nandbiterrs test, firstly
> write data to flash with ECC code in oob area, then change some bits
> and rewrite data to flash with old ECC code in oob area, at last read
> data out with ECC to test if the "error bits" can be corrected. My
> explanation is that in rewriting process NAND controller also produces
> new ECC code of the data and write both data and new ECC code to flash.
> So in next step we will get what was writen without "correction".
But we should at least get an -EBADMSG return status, right? If you're
"rewriting" the data, this should result in two sets of data written on
top of each other, which (depending on the flash layout charecteristics)
might turn up as a kind of logical AND of all the data+OOB. This is
"probably" not correctable.
But that last "probably" leaves room for the possibility you mentioned,
I guess; that the ECC code is just correcting the data to look like the
second set of (intentionally) erroneous data.
> >I'd recommend digging a little more to figure out what's wrong here. You
> >might need to instrument the nandbiterrs test. This is possibly
>
> Thanks, I will do it.
>
> >highlighting a driver bug [1].
> >
> >Brian
> >
> >[1] Besised simply that you didn't implement write_page_raw(). The
> >default nand_write_page_raw() implementation looks just like your
> >non-raw version.
>
> Yes. In ECC mode, as the NAND controller must write page as a whole
> with ECC code, the default nand_write_page_raw() looks just like
> non-raw version.
Are you saying you cannot implement the raw() hooks for this IP? Or just
that you haven't yet? The latter is probably OK for now (I'd recommend
doing this, or at least mark a TODO in the code), but the former is a
little disturbing.
Brian
next prev parent reply other threads:[~2015-01-13 4:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 12:46 [PATCH v4 0/2] mtd: hisilicon: add a new driver for NAND controller of hisilicon hip04 Soc Zhou Wang
2014-11-04 12:47 ` [PATCH v4 1/2] mtd: hisilicon: add a new NAND controller driver for " Zhou Wang
2014-11-30 9:35 ` Brian Norris
2014-12-01 13:08 ` Zhou Wang
2014-12-01 18:14 ` Brian Norris
2014-12-01 9:25 ` Brian Norris
2014-12-01 13:08 ` Zhou Wang
2014-11-04 12:47 ` [PATCH v4 2/2] mtd: hisilicon: add device tree binding documentation Zhou Wang
2014-11-30 8:56 ` Brian Norris
2014-12-01 13:08 ` Zhou Wang
2014-11-30 9:01 ` Brian Norris
2014-12-01 13:07 ` Zhou Wang
2014-11-06 3:05 ` [PATCH v4 0/2] mtd: hisilicon: add a new driver for NAND controller of hisilicon hip04 Soc Haojian Zhuang
2014-11-26 6:35 ` Haojian Zhuang
2014-11-30 9:08 ` Brian Norris
2014-12-01 13:06 ` Zhou Wang
2014-12-11 12:02 ` Zhou Wang
2014-12-17 1:03 ` Brian Norris
2014-12-17 5:06 ` Zhou Wang
2014-12-17 6:23 ` Brian Norris
2014-12-17 11:05 ` Zhou Wang
2015-01-13 4:17 ` Brian Norris [this message]
2015-01-22 3:27 ` Zhou Wang
2015-01-22 8:45 ` Brian Norris
2015-01-25 8:19 ` Zhou Wang
2015-02-06 1:33 ` Brian Norris
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=20150113041701.GM9759@ld-irv-0074 \
--to=computersforpeace@gmail.com \
--cc=Iwo.Mergler@netcommwireless.com \
--cc=caizhiyong@huawei.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=galak@codeaurora.org \
--cc=haojian.zhuang@gmail.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=liguozhu@hisilicon.com \
--cc=linux-mtd@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=wangzhou.bry@gmail.com \
--cc=wangzhou1@hisilicon.com \
--cc=xuwei5@hisilicon.com \
--cc=yubingxu@hisilicon.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).