linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Tudor Ambarus <Tudor.Ambarus@microchip.com>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Vladimir Zapolskiy <vz@mleia.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	stable@vger.kernel.org
Subject: [PATCH 1/8] mtd: rawnand: fsmc: Fix use of SM ORDER
Date: Wed, 29 Sep 2021 00:15:00 +0200	[thread overview]
Message-ID: <20210928221507.199198-2-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20210928221507.199198-1-miquel.raynal@bootlin.com>

The introduction of the generic ECC engine API lead to a number of
changes in various drivers which broke some of them. Here is a typical
example: I expected the SM_ORDER option to be handled by the Hamming ECC
engine internals. Problem: the fsmc driver does not instantiate (yet) a
real ECC engine object so we had to use a 'bare' ECC helper instead of
the shiny rawnand functions. However, when not intializing this engine
properly and using the bare helpers, we do not get the SM ORDER feature
handled automatically. It looks like this was lost in the process so
let's ensure we use the right SM ORDER now.

Fixes: ad9ffdce4539 ("mtd: rawnand: fsmc: Fix external use of SW Hamming ECC helper")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/fsmc_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index a3e66155ae40..658f0cbe7ce8 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -438,8 +438,10 @@ static int fsmc_correct_ecc1(struct nand_chip *chip,
 			     unsigned char *read_ecc,
 			     unsigned char *calc_ecc)
 {
+	bool sm_order = chip->ecc.options & NAND_ECC_SOFT_HAMMING_SM_ORDER;
+
 	return ecc_sw_hamming_correct(buf, read_ecc, calc_ecc,
-				      chip->ecc.size, false);
+				      chip->ecc.size, sm_order);
 }
 
 /* Count the number of 0's in buff upto a max of max_bits */
-- 
2.27.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-09-28 22:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 22:14 [PATCH 0/8] Cleanup series about Hamming helpers Miquel Raynal
2021-09-28 22:15 ` Miquel Raynal [this message]
2021-10-15 10:33   ` [PATCH 1/8] mtd: rawnand: fsmc: Fix use of SM ORDER Miquel Raynal
2021-09-28 22:15 ` [PATCH 2/8] mtd: rawnand: Let callers use the bare Hamming helpers Miquel Raynal
2021-10-15 10:33   ` Miquel Raynal
2021-09-28 22:15 ` [PATCH 3/8] Revert "mtd: rawnand: txx9ndfmc: Fix external use of SW Hamming ECC helper" Miquel Raynal
2021-10-15 10:33   ` Miquel Raynal
2021-09-28 22:15 ` [PATCH 4/8] Revert "mtd: rawnand: tmio: " Miquel Raynal
2021-10-15 10:33   ` Miquel Raynal
2021-09-28 22:15 ` [PATCH 5/8] Revert "mtd: rawnand: sharpsl: " Miquel Raynal
2021-10-15 10:32   ` Miquel Raynal
2021-09-28 22:15 ` [PATCH 6/8] Revert "mtd: rawnand: ndfc: " Miquel Raynal
2021-10-15 10:32   ` Miquel Raynal
2021-09-28 22:15 ` [PATCH 7/8] Revert "mtd: rawnand: lpc32xx_slc: " Miquel Raynal
2021-10-15 10:32   ` Miquel Raynal
2021-09-28 22:15 ` [PATCH 8/8] Revert "mtd: rawnand: cs553x: " Miquel Raynal
2021-10-15 10:32   ` 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=20210928221507.199198-2-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=Tudor.Ambarus@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=vigneshr@ti.com \
    --cc=vz@mleia.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).