linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Abhishek Sahu <absahu@codeaurora.org>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Boris Brezillon <boris.brezillon@bootlin.com>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mtd@lists.infradead.org, Andy Gross <andy.gross@linaro.org>,
	Archit Taneja <architt@codeaurora.org>
Subject: Re: [PATCH v5] mtd: rawnand: qcom: erased page bitflips detection
Date: Sun, 8 Jul 2018 23:47:42 +0200	[thread overview]
Message-ID: <20180708234742.0d86b9d1@xps13> (raw)
In-Reply-To: <1530619563-24712-1-git-send-email-absahu@codeaurora.org>

Hi Abhishek,

Abhishek Sahu <absahu@codeaurora.org> wrote on Tue,  3 Jul 2018
17:36:03 +0530:

> NAND parts can have bitflips in an erased page due to the
> process technology used. In this case, QCOM NAND controller
> is not able to identify that page as an erased page.
> Currently the driver calls nand_check_erased_ecc_chunk() for
> identifying the erased pages but this won’t work always since the
> checking is being with ECC engine returned data. In case of
> bitflips, the ECC engine tries to correct the data and then it
> generates the uncorrectable error. Now, this data is not equal to
> original raw data. For erased CW identification, the raw data
> should be read again from NAND device and this
> nand_check_erased_ecc_chunk function() should be called for raw
> data only.
> 
> Now following logic is being added to identify the erased
> codeword bitflips.
> 
> 1. In most of the cases, not all the codewords will have bitflips
>    and only single CW will have bitflips. So, there is no need to
>    read the complete raw page data. The NAND raw read can be
>    scheduled for any CW in page. The NAND controller works on CW
>    basis and it will update the status register after each CW read.
>    Maintain the bitmask for the CW which generated the uncorrectable
>    error.
> 2. Do raw read for all the CW's which generated the uncorrectable
>    error.
> 3. Both DATA and OOB need to be checked for number of 0. The
>    top-level API can be called with only data buf or OOB buf so use
>    chip->databuf if data buf is null and chip->oob_poi if
>    OOB buf is null for copying the raw bytes temporarily.
> 4. For each CW, check the number of 0 in cw_data and usable
>    oob bytes, The bbm and spare (unused) bytes bit flip won’t
>    affect the ECC so don’t check the number of bitflips in this area.
> 
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> ---
> * Changes from v4:
> 
>  1. Used for_each_set_bit for determining CW’s which generated
>     uncorrectable errors.
>  2. Introduced cw_data_buf and cw_oob_buf which will have starting
>     buffer address for current codeword and used the same in helper
>     functions.
>  3. Added new line before calling of nand_check_erased_ecc_chunk for
>     better code readability.
> 
> * Changes from v3:
> 
>  1. Major changes in erased codeword detection for
>     raw read function
> 
> * Changes from v2:
>   NONE
> 
> * Changes from v1:
>  1. Minor change in commit message
>  2. invalidate pagebuf if databuf or oob_poi is used
> 
>  drivers/mtd/nand/raw/qcom_nandc.c | 126 +++++++++++++++++++++++++++-----------
>  1 file changed, 89 insertions(+), 37 deletions(-)

Applied to nand/next.

Thanks,
Miquèl

      reply	other threads:[~2018-07-08 21:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 12:06 [PATCH v5] mtd: rawnand: qcom: erased page bitflips detection Abhishek Sahu
2018-07-08 21:47 ` Miquel Raynal [this message]

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=20180708234742.0d86b9d1@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=absahu@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=architt@codeaurora.org \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.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;
as well as URLs for NNTP newsgroup(s).