From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-mtd@lists.infradead.org
Subject: Re: nand_ecc_is_strong_enough() doesn't trigger
Date: Tue, 7 May 2024 14:30:36 +0200 [thread overview]
Message-ID: <20240507143036.1cf1a3fd@xps-13> (raw)
In-Reply-To: <Zhe2JtvvN1M4Ompw@pengutronix.de>
Hi,
s.hauer@pengutronix.de wrote on Thu, 11 Apr 2024 12:06:30 +0200:
> Hi,
>
> I am currently working with a NAND chip requiring 4 bit correction per
> 512 byte data while my NAND driver only supports 1 bit correction, so
> I would assume this to trigger:
>
> /* ECC sanity check: warn if it's too weak */
> if (!nand_ecc_is_strong_enough(&chip->base))
> pr_warn("WARNING: %s: the ECC used on your system (%db/%dB) is too weak compared to the one required by the NAND chip (%db/%dB)\n",
> mtd->name, chip->ecc.strength, chip->ecc.size,
> nanddev_get_ecc_requirements(&chip->base)->strength,
> nanddev_get_ecc_requirements(&chip->base)->step_size);
>
> nand_ecc_is_strong_enough() works on nand->ecc.ctx.conf.step_size, but
> this only ever seems to be initialized by the various ecc-sw-*
> algorithms.
>
> This was changed in 8c126720fe10 ("mtd: rawnand: Use the ECC framework
> nand_ecc_is_strong_enough() helper"). Before this patch the initialized
> values in &(struct nand_chip *chip)->ecc were used (and which are still
> used in the warning message above).
>
> Do you have a direction how this should be fixed?
I looked into it, we need to make sure the ECC values are propagated to
the upper layers. If other people are following the thread, here is the
proposal:
https://lore.kernel.org/linux-mtd/20240507085842.108844-1-miquel.raynal@bootlin.com/T/#u
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2024-05-07 12:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-11 10:06 nand_ecc_is_strong_enough() doesn't trigger Sascha Hauer
2024-05-07 12:30 ` 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=20240507143036.1cf1a3fd@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=linux-mtd@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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.