From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Daniel Golle <daniel@makrotopia.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Chia-Lin Kao <acelan.kao@canonical.com>,
Martin Kurbanov <mmkurbanov@salutedevices.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: spinand: set bitflip_threshold to 75% of ECC strength
Date: Mon, 12 Aug 2024 09:26:23 +0200 [thread overview]
Message-ID: <1b72edfc-e1fb-4987-b874-7fe977ff56a3@kontron.de> (raw)
In-Reply-To: <2117e387260b0a96f95b8e1652ff79e0e2d71d53.1723427450.git.daniel@makrotopia.org>
Hi Daniel,
On 12.08.24 3:56 AM, Daniel Golle wrote:
> Reporting an unclean read from SPI-NAND only when the maximum number
> of correctable bitflip errors has been hit seems a bit late.
> UBI LEB scrubbing, which depends on the lower MTD device reporting
> correctable bitflips, then only kicks in when it's almost too late.
>
> Set bitflip_threshold to 75% of the ECC strength, which is also the
> default for raw NAND.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/mtd/nand/spi/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index e0b6715e5dfed..018c854d06193 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -1287,6 +1287,7 @@ static int spinand_init(struct spinand_device *spinand)
> /* Propagate ECC information to mtd_info */
> mtd->ecc_strength = nanddev_get_ecc_conf(nand)->strength;
> mtd->ecc_step_size = nanddev_get_ecc_conf(nand)->step_size;
> + mtd->bitflip_threshold = DIV_ROUND_UP(mtd->ecc_strength * 3, 4);
Is this just a theoretical adjustment or did you encounter any issues on
a real device? If the latter, could you add a sentence about your
use-case to the commit message?
In general the change looks good to me, so feel free to add:
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
But it would still be good to hear further opinions.
Thanks
Frieder
next prev parent reply other threads:[~2024-08-12 7:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 1:56 Daniel Golle
2024-08-12 7:26 ` Frieder Schrempf [this message]
2024-08-23 17:35 ` Miquel Raynal
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=1b72edfc-e1fb-4987-b874-7fe977ff56a3@kontron.de \
--to=frieder.schrempf@kontron.de \
--cc=acelan.kao@canonical.com \
--cc=daniel@makrotopia.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mika.westerberg@linux.intel.com \
--cc=miquel.raynal@bootlin.com \
--cc=mmkurbanov@salutedevices.com \
--cc=richard@nod.at \
--cc=tudor.ambarus@linaro.org \
--cc=vigneshr@ti.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
all inboxes | Powered by JetHome®