All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: linux-mtd@lists.infradead.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Graham Moore <grmoore@opensource.altera.com>,
	Enrico Jorns <ejo@pengutronix.de>,
	Chuanxiao Dong <chuanxiao.dong@intel.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>
Subject: Re: [PATCH v3 32/37] mtd: nand: denali: support hardware-assisted erased page detection
Date: Tue, 6 Jun 2017 11:04:19 +0900	[thread overview]
Message-ID: <CAK7LNARFJfKHNOkOJkbLad0Chqsf=3mMdLJkagNKpc-gQwzsLQ@mail.gmail.com> (raw)
In-Reply-To: <20170330183030.14acbb47@bbrezillon>

Hi Boris,


2017-03-31 1:30 GMT+09:00 Boris Brezillon <boris.brezillon@free-electrons.com>:
> On Thu, 30 Mar 2017 17:15:03 +0900
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
>> Recent versions of this IP support automatic erased page detection.
>> If an erased page is detected on reads, the controller does not set
>> INTR__ECC_UNCOR_ERR, but INTR__ERASED_PAGE.  If this feature is
>> supported, the driver can use this information instead of calling
>> nand_check_erased_ecc_chunk().
>>
>> The detection of erased page is based on the number of zeros in the
>> page; if the number of zeros is less than the value in the field
>> ERASED_THRESHOLD, the page is assumed as erased.
>>
>> Set the ERASED_THRESHOLD to (chip->ecc.strength + 1).  This is the
>> worst case where all the bitflips come from the same ECC sector.
>> This field is Reserved for older IP versions, so this commit has
>> no impact on them.
>
> Do you have a way to know the actual number of bitflips in an erased
> ECC block?

There is no way to the actual number of bitflips
except that the driver parses the whole buffer counting bitflips.


> BTW, is the threshold a per-page information or a per ECC
> block information.

Per-page.

Honestly, this hardware feature is not nice
because per-chunk threshold makes sense .




> If you can't know the real number of bitflips I don't think it's safe
> to set the threshold to chip->ecc.strength + 1.

Right.

> You can still use the feature to detect erased pages without any
> bitflips (set ERASED_THRESHOLD to 1), which should be the case most of
> the time, but for cases where you have bitflips I'd recommend using
> nand_check_erased_ecc_chunk() if you can't know the actual number of
> bitflips in the page.
>

You are right.


Probably, this feature can work safely
only when ERASED_THRESHOLD == 1.


I decided to drop this patch from v4 for now,
but I will consider it.


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2017-06-06  2:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  8:15 [PATCH v3 31/37] mtd: nand: denali: fix raw and oob accessors for syndrome page layout Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 32/37] mtd: nand: denali: support hardware-assisted erased page detection Masahiro Yamada
2017-03-30 16:30   ` Boris Brezillon
2017-06-06  2:04     ` Masahiro Yamada [this message]
2017-03-30  8:15 ` [PATCH v3 33/37] mtd: nand: allocate aligned buffers if NAND_OWN_BUFFERS is unset Masahiro Yamada
2017-04-06 14:08   ` Leonard Crestez
2017-04-07  6:49     ` Masahiro Yamada
2017-04-09  7:33       ` Boris Brezillon
2017-04-09 14:17   ` Boris Brezillon
2017-04-09 14:17     ` Boris Brezillon
2017-04-10  0:20     ` Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 34/37] mtd: nand: allow drivers to request minimum alignment for passed buffer Masahiro Yamada
2017-03-31  4:01   ` Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 35/37] mtd: nand: denali: skip driver internal bounce buffer when possible Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 36/37] mtd: nand: denali: use non-managed kmalloc() for DMA buffer Masahiro Yamada
2017-03-30  8:15 ` [PATCH v3 37/37] mtd: nand: denali: enable bad block table scan Masahiro Yamada

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='CAK7LNARFJfKHNOkOJkbLad0Chqsf=3mMdLJkagNKpc-gQwzsLQ@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=dinguyen@kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=ejo@pengutronix.de \
    --cc=grmoore@opensource.altera.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=mhiramat@kernel.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.