All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: David Regan <dregan@broadcom.com>
Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	william.zhang@broadcom.com, anand.gore@broadcom.com,
	florian.fainelli@broadcom.com, kamal.dasu@broadcom.com,
	dan.beygelman@broadcom.com,
	"Álvaro Fernández Rojas" <noltari@gmail.com>,
	rafal@milecki.pl, computersforpeace@gmail.com,
	frieder.schrempf@kontron.de, vigneshr@ti.com, richard@nod.at,
	bbrezillon@kernel.org, kdasu.kdev@gmail.com,
	jaimeliao.tw@gmail.com, kilobyte@angband.pl,
	jonas.gorski@gmail.com, dgcbueu@gmail.com, dregan@mail.com
Subject: Re: [PATCH v2] mtd: nand: brcmnand: fix mtd corrected bits stat
Date: Mon, 09 Jun 2025 11:20:09 +0200	[thread overview]
Message-ID: <8734c9z2ye.fsf@bootlin.com> (raw)
In-Reply-To: <20250606165756.1531164-1-dregan@broadcom.com> (David Regan's message of "Fri, 6 Jun 2025 09:57:03 -0700")

On 06/06/2025 at 09:57:03 -07, David Regan <dregan@broadcom.com> wrote:

> Currently we attempt to get the amount of flipped bits from a hardware
> location which is reset on every subpage. Instead obtain total flipped
> bits stat from hardware accumulator. In addition identify the correct
> maximum subpage corrected bits.
>
> Signed-off-by: David Regan <dregan@broadcom.com>
> Reviewed-by: William Zhang <william.zhang@broadcom.com>
> ---

Hello,

Can you please give the output of nandbiterrs -i /dev/mtdX?

>  v2: Add >= v4 NAND controller support as requested by Jonas.
>      mtd->ecc_stats.corrected accumulates instead of set to total.
>      Remove DMA specific flipped bits count.

The changelog does not mention the fact that you return the maximum
number of corrected bitflips as I requested, and the diff does not show
a straightforward implementation of that. It is very important to get
this right.

If we take the following example of a page with 4 ECC steps, if we get
respectively: 0, 2, 3, 0 bitflips per step, the returned value shall be
3.

To be very certain that this is correct, you can use the nandflipbit
tool from the mtd-utils test suite. You can manually insert bitflips in
various areas of a page and then read the page again with ECC enabled
and see how many bit errors are reported.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: David Regan <dregan@broadcom.com>
Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	william.zhang@broadcom.com, anand.gore@broadcom.com,
	florian.fainelli@broadcom.com, kamal.dasu@broadcom.com,
	dan.beygelman@broadcom.com,
	"Álvaro Fernández Rojas" <noltari@gmail.com>,
	rafal@milecki.pl, computersforpeace@gmail.com,
	frieder.schrempf@kontron.de, vigneshr@ti.com, richard@nod.at,
	bbrezillon@kernel.org, kdasu.kdev@gmail.com,
	jaimeliao.tw@gmail.com, kilobyte@angband.pl,
	jonas.gorski@gmail.com, dgcbueu@gmail.com, dregan@mail.com
Subject: Re: [PATCH v2] mtd: nand: brcmnand: fix mtd corrected bits stat
Date: Mon, 09 Jun 2025 11:20:09 +0200	[thread overview]
Message-ID: <8734c9z2ye.fsf@bootlin.com> (raw)
In-Reply-To: <20250606165756.1531164-1-dregan@broadcom.com> (David Regan's message of "Fri, 6 Jun 2025 09:57:03 -0700")

On 06/06/2025 at 09:57:03 -07, David Regan <dregan@broadcom.com> wrote:

> Currently we attempt to get the amount of flipped bits from a hardware
> location which is reset on every subpage. Instead obtain total flipped
> bits stat from hardware accumulator. In addition identify the correct
> maximum subpage corrected bits.
>
> Signed-off-by: David Regan <dregan@broadcom.com>
> Reviewed-by: William Zhang <william.zhang@broadcom.com>
> ---

Hello,

Can you please give the output of nandbiterrs -i /dev/mtdX?

>  v2: Add >= v4 NAND controller support as requested by Jonas.
>      mtd->ecc_stats.corrected accumulates instead of set to total.
>      Remove DMA specific flipped bits count.

The changelog does not mention the fact that you return the maximum
number of corrected bitflips as I requested, and the diff does not show
a straightforward implementation of that. It is very important to get
this right.

If we take the following example of a page with 4 ECC steps, if we get
respectively: 0, 2, 3, 0 bitflips per step, the returned value shall be
3.

To be very certain that this is correct, you can use the nandflipbit
tool from the mtd-utils test suite. You can manually insert bitflips in
various areas of a page and then read the page again with ECC enabled
and see how many bit errors are reported.

Thanks,
Miquèl

  reply	other threads:[~2025-06-09  9:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06 16:57 [PATCH v2] mtd: nand: brcmnand: fix mtd corrected bits stat David Regan
2025-06-06 16:57 ` David Regan
2025-06-09  9:20 ` Miquel Raynal [this message]
2025-06-09  9:20   ` Miquel Raynal
2025-06-11  0:44   ` David Regan
2025-06-11  0:44     ` David Regan
2025-06-18  9:07     ` Miquel Raynal
2025-06-18  9:07       ` Miquel Raynal
2025-06-19 18:11       ` Florian Fainelli
2025-06-19 18:11         ` Florian Fainelli
2025-06-19 18:23       ` David Regan
2025-06-19 18:23         ` David Regan
2025-06-26 16:15       ` David Regan
2025-06-26 16:15         ` David Regan

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=8734c9z2ye.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=anand.gore@broadcom.com \
    --cc=bbrezillon@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=computersforpeace@gmail.com \
    --cc=dan.beygelman@broadcom.com \
    --cc=dgcbueu@gmail.com \
    --cc=dregan@broadcom.com \
    --cc=dregan@mail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=jaimeliao.tw@gmail.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kamal.dasu@broadcom.com \
    --cc=kdasu.kdev@gmail.com \
    --cc=kilobyte@angband.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=noltari@gmail.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=william.zhang@broadcom.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 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.