From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Tudor Ambarus <Tudor.Ambarus@microchip.com>,
<linux-mtd@lists.infradead.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH 2/9] mtd: rawnand: au1550: Do not force a particular software ECC engine
Date: Thu, 3 Dec 2020 20:03:33 +0100 [thread overview]
Message-ID: <20201203190340.15522-3-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20201203190340.15522-1-miquel.raynal@bootlin.com>
Originally, commit d7157ff49a5b ("mtd: rawnand: Use the ECC framework
user input parsing bits") kind of broke the logic around the
initialization of several ECC engines.
Unfortunately, the fix (which indeed moved the ECC initialization to
the right place) did not take into account the fact that a different
ECC algorithm could have been used thanks to a DT property,
considering the "Hamming" algorithm entry a configuration while it was
only a default.
Add the necessary logic to be sure Hamming keeps being only a default.
Fixes: dbffc8ccdf3a ("mtd: rawnand: au1550: Move the ECC initialization to ->attach_chip()")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/au1550nd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c
index 7892022bd6dd..7b6b354f2d39 100644
--- a/drivers/mtd/nand/raw/au1550nd.c
+++ b/drivers/mtd/nand/raw/au1550nd.c
@@ -239,7 +239,9 @@ static int au1550nd_exec_op(struct nand_chip *this,
static int au1550nd_attach_chip(struct nand_chip *chip)
{
chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
- chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
+
+ if (chip->ecc.algo == NAND_ECC_ALGO_UNKNOWN)
+ chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
return 0;
}
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-12-03 19:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 19:03 [PATCH 0/9] mtd: rawnand: Do not overwrite user settings Miquel Raynal
2020-12-03 19:03 ` [PATCH 1/9] mtd: rawnand: ams-delta: Do not force a particular software ECC engine Miquel Raynal
2020-12-04 16:21 ` Miquel Raynal
2020-12-03 19:03 ` Miquel Raynal [this message]
2020-12-04 16:21 ` [PATCH 2/9] mtd: rawnand: au1550: " Miquel Raynal
2020-12-03 19:03 ` [PATCH 3/9] mtd: rawnand: gpio: " Miquel Raynal
2020-12-04 16:21 ` Miquel Raynal
2020-12-03 19:03 ` [PATCH 4/9] mtd: rawnand: mpc5121: " Miquel Raynal
2020-12-04 16:21 ` Miquel Raynal
2020-12-03 19:03 ` [PATCH 5/9] mtd: rawnand: orion: " Miquel Raynal
2020-12-04 16:20 ` Miquel Raynal
2020-12-03 19:03 ` [PATCH 6/9] mtd: rawnand: pasemi: " Miquel Raynal
2020-12-04 16:20 ` Miquel Raynal
2020-12-03 19:03 ` [PATCH 7/9] mtd: rawnand: plat_nand: " Miquel Raynal
2020-12-04 16:20 ` Miquel Raynal
2020-12-03 19:03 ` [PATCH 8/9] mtd: rawnand: socrates: " Miquel Raynal
2020-12-04 16:20 ` Miquel Raynal
2020-12-03 19:03 ` [PATCH 9/9] mtd: rawnand: xway: " Miquel Raynal
2020-12-04 16:20 ` 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=20201203190340.15522-3-miquel.raynal@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=Tudor.Ambarus@microchip.com \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--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;
as well as URLs for NNTP newsgroup(s).