From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Cc: "markus.stockhausen@gmx.de" <markus.stockhausen@gmx.de>,
"vigneshr@ti.com" <vigneshr@ti.com>,
"richard@nod.at" <richard@nod.at>,
"tudor.ambarus@linaro.org" <tudor.ambarus@linaro.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: AW: NAND ECC errors
Date: Fri, 08 Aug 2025 10:41:35 +0200 [thread overview]
Message-ID: <87pld6b3y8.fsf@bootlin.com> (raw)
In-Reply-To: <a1794cf8-ed93-45db-8ac1-7e5d2ccd9fe9@alliedtelesis.co.nz> (Chris Packham's message of "Thu, 7 Aug 2025 21:32:37 +0000")
On 07/08/2025 at 21:32:37 GMT, Chris Packham <Chris.Packham@alliedtelesis.co.nz> wrote:
> On 08/08/2025 09:23, markus.stockhausen@gmx.de wrote:
>>> Anyone good ideas what to do first from here?
>>>
>>> Probably depends. Blanking the NAND chip and reformatting it will
>>> resolve the errors from and upstream point of view. That's obviously not
>>> really going to be something you want to do if you expect to swap back
>>> and forth between the stock firmware and an upstream kernel.
>>>
>>> You'll probably want to convince the mtd code to allow the on-die ECC to
>>> be disabled and find whatever software BCH settings are needed that work
>>> with the stock firmware. Then we could maybe look at using the ECC
>>> controller to accelerate that.
>> Good direction. So assumption is:
>> - vendor wrote BCH6 into OOB
>> - This design is also active in his firmware (with Realtek ECC engine)
>> - now we read data with upstream kernel and on-die ECC
>> - Each read produces an on-die ECC error
>> - As soon as we write new data on-die ECC will be created
>>
>> But where is the ECC knob in between spi-realtek-nand, mtd and ubi?
> Yeah that's the part I don't know. I don't think there is an existing
> one for SPI-NAND (there is one for parallel NAND). I think it's a chip
> level thing so spi-realtek-nand will probably be ignorant of any such
> option (at least until the ECC controller comes into play). I also think
> ubi doesn't care who does the ECC as long as they tell them when there
> is an error.
As explained in my other answer, you can now choose between ECC engines
when there are several. All happens at the SPI NAND level though, MTD,
UBI of filesystems are ignorant about it. They just expect (corrected)
data.
However if your fw used to play with an external or pipelined ECC
engine, you are good to write a driver for it! But be happy, now there
is all the infrastructure needed for it.
Reference implementations:
- drivers/mtd/nand/ecc-mxic.c
- drivers/mtd/nand/ecc-mtk.c
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2025-08-08 8:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-07 15:16 NAND ECC errors markus.stockhausen
2025-08-07 20:36 ` Chris Packham
2025-08-07 21:23 ` AW: " markus.stockhausen
2025-08-07 21:32 ` Chris Packham
2025-08-08 8:41 ` Miquel Raynal [this message]
2025-08-08 12:25 ` AW: " markus.stockhausen
2025-08-08 12:41 ` Miquel Raynal
2025-08-08 13:21 ` AW: " markus.stockhausen
2025-08-08 13:31 ` Miquel Raynal
2025-08-08 8:37 ` 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=87pld6b3y8.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=Chris.Packham@alliedtelesis.co.nz \
--cc=linux-mtd@lists.infradead.org \
--cc=markus.stockhausen@gmx.de \
--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 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.