LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Daniel Kestrel <kestrelseventyfour@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Daniel Kestrel <kestrelseventyfour@gmail.com>
Subject: [PATCH v2] mtd: rawnand: xway: No hardcoded ECC engine, use device tree setting
Date: Sun, 8 Aug 2021 09:26:43 +0200	[thread overview]
Message-ID: <20210808072643.GA5084@ubuntu> (raw)

Some devices use Micron NAND chips, which use on-die ECC. The hardcoded
setting of NAND_ECC_ENGINE_TYPE_SOFT makes them unusable, because the
software ECC on top of the hardware ECC produces errors for every read
and write access, not to mention that booting does not work, because
the boot loader uses the correct ECC when trying to load the kernel
and stops loading on severe ECC errors.
This patch requires the devices that currently work with the hard coded
setting to set the nand-ecc-mode property to soft in their device
tree.

Signed-off-by: Daniel Kestrel <kestrelseventyfour@gmail.com>
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl> # tested on BT Home Hub 5A
---
 drivers/mtd/nand/raw/xway_nand.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/xway_nand.c b/drivers/mtd/nand/raw/xway_nand.c
index 26751976e502..0a4b0aa7dd4c 100644
--- a/drivers/mtd/nand/raw/xway_nand.c
+++ b/drivers/mtd/nand/raw/xway_nand.c
@@ -148,8 +148,6 @@ static void xway_write_buf(struct nand_chip *chip, const u_char *buf, int len)
 
 static int xway_attach_chip(struct nand_chip *chip)
 {
-	chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
-
 	if (chip->ecc.algo == NAND_ECC_ALGO_UNKNOWN)
 		chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
 
-- 
2.17.1


             reply	other threads:[~2021-08-08  7:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-08  7:26 Daniel Kestrel [this message]
2021-08-16  7:31 ` Miquel Raynal
2021-08-19  7:21   ` Kestrel seventyfour
2021-08-19  8:03     ` Miquel Raynal
2021-08-23 11:19       ` Kestrel seventyfour
2021-08-23 15:24         ` Miquel Raynal
2021-08-24  7:15           ` Kestrel seventyfour
2021-08-24 17:22             ` Miquel Raynal
2021-08-25  8:47               ` Kestrel seventyfour
2021-08-25  8:51                 ` Miquel Raynal
2021-08-25 14:07                   ` Kestrel seventyfour
2021-08-25 15:31                     ` Miquel Raynal
2021-08-26  5:27                       ` Kestrel seventyfour
2021-09-16 19:38 ` Jan Hoffmann
2021-09-17 17:01   ` Miquel Raynal
2021-09-17 17:45     ` Jan Hoffmann
2021-09-17 19:32       ` Miquel Raynal
2021-09-18 21:26         ` Jan Hoffmann
2021-09-27 16:31           ` Miquel Raynal
2021-09-27 20:32             ` Jan Hoffmann
2021-09-28  8:49               ` 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=20210808072643.GA5084@ubuntu \
    --to=kestrelseventyfour@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --subject='Re: [PATCH v2] mtd: rawnand: xway: No hardcoded ECC engine, use device tree setting' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).