From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Darwin Dingel <Darwin.Dingel@alliedtelesis.co.nz>
Cc: Pavel Machek <pavel@ucw.cz>, "richard@nod.at" <richard@nod.at>,
"dwmw2@infradead.org" <dwmw2@infradead.org>,
"computersforpeace@gmail.com" <computersforpeace@gmail.com>,
"marek.vasut@gmail.com" <marek.vasut@gmail.com>,
"cyrille.pitchen@atmel.com" <cyrille.pitchen@atmel.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mark.marshall@omicronenergy.com"
<mark.marshall@omicronenergy.com>,
"b44839@freescale.com" <b44839@freescale.com>,
"prabhakar@freescale.com" <prabhakar@freescale.com>
Subject: Re: mtd: nand: fsl_ifc: fix handing of bit flips in erased pages
Date: Mon, 29 May 2017 10:48:38 +0200 [thread overview]
Message-ID: <20170529104838.48225166@bbrezillon> (raw)
In-Reply-To: <5f665145ea304d3a9e1ecb39c51a951e@svr-chch-ex1.atlnz.lc>
Hi,
On Thu, 25 May 2017 23:33:43 +0000
Darwin Dingel <Darwin.Dingel@alliedtelesis.co.nz> wrote:
> Hi,
>
> We are also having the same problem where the IFC (nand flash) was
> reporting ECC uncorrectable errors on single bitflips with erased pages.
> Applying this patch with some minor modifications seems to solve our
> issue. We are still doing more testing but recent results looks promising.
Pavel, can you send a v2 fixing these problems?
Thanks,
Boris
>
> Our kernel is 4.4.6 so we have to modify it a bit to fit the old ECC
> layout structure. We just have a few comments about the patch:
>
> > - if (!is_blank(mtd, bufnum))
> > - ctrl->nand_stat |=
> > - IFC_NAND_EVTER_STAT_ECCER;
> > - break;
> > + ctrl->nand_stat |= IFC_NAND_EVTER_STAT_ECCER;
>
> Added 'error = 0' after setting the flag since no error was actually
> corrected.
>
> > - if (ctrl->nand_stat & IFC_NAND_EVTER_STAT_ECCER)
> > - dev_err(priv->dev, "NAND Flash ECC Uncorrectable Error\n");
> > -
> > if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
> > mtd->ecc_stats.failed++;
> > +
> > + if (ctrl->nand_stat & IFC_NAND_EVTER_STAT_ECCER) {
> > + int res;
> > +
> > + if (!oob_required)
> > + fsl_ifc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
> > +
> > + res = check_erased_page(chip, buf);
> > + return res;
> > + }
>
> We have to do the check IFC_NAND_EVTER_STAT_ECCER first because the
> condition (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC) will never be
> true since IFC always sets IFC_NAND_EVTER_STAT_ECCER on empty pages.
> Incrementing failed stats first before doing check_erased_page() makes
> nand_read() report ECC error all time.
>
> Our exact modification was:
> if (ctrl->nand_stat & IFC_NAND_EVTER_STAT_ECCER) {
> if (!oob_required)
> fsl_ifc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
>
> return check_erased_page(chip, buf);
> }
>
> if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
> mtd->ecc_stats.failed++;
>
> Because check_erased_page() will be updating the failed stat anyway.
>
>
> Cheers,
> Darwin
next parent reply other threads:[~2017-05-29 8:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5f665145ea304d3a9e1ecb39c51a951e@svr-chch-ex1.atlnz.lc>
2017-05-29 8:48 ` Boris Brezillon [this message]
2017-05-31 22:18 ` mtd: nand: fsl_ifc: fix handing of bit flips in erased pages Pavel Machek
2017-05-31 20:49 ` Pavel Machek
2017-05-31 21:52 ` Darwin Dingel
2017-05-31 22:15 ` Pavel Machek
2017-06-07 21:59 ` Darwin Dingel
2017-06-13 8:24 ` Pavel Machek
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=20170529104838.48225166@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=Darwin.Dingel@alliedtelesis.co.nz \
--cc=b44839@freescale.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@atmel.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=mark.marshall@omicronenergy.com \
--cc=pavel@ucw.cz \
--cc=prabhakar@freescale.com \
--cc=richard@nod.at \
/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