This is a note to let you know that I've just added the patch titled mtd: rawnand: fsmc: Fix use of SM ORDER to the 5.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mtd-rawnand-fsmc-fix-use-of-sm-order.patch and it can be found in the queue-5.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 9be1446ece291a1f08164bd056bed3d698681f8b Mon Sep 17 00:00:00 2001 From: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> Date: Wed, 29 Sep 2021 00:15:00 +0200 Subject: mtd: rawnand: fsmc: Fix use of SM ORDER From: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> commit 9be1446ece291a1f08164bd056bed3d698681f8b upstream. 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@xxxxxxxxxxxxxxx Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> Link: https://lore.kernel.org/linux-mtd/20210928221507.199198-2-miquel.raynal@xxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mtd/nand/raw/fsmc_nand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- 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 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 */ Patches currently in stable-queue which might be from miquel.raynal@xxxxxxxxxxx are queue-5.14/mtd-rawnand-intel-fix-potential-buffer-overflow-in-p.patch queue-5.14/mtd-rawnand-socrates-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-ams-delta-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-gpio-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-fsmc-fix-use-of-sm-order.patch queue-5.14/mtd-rawnand-au1550nd-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-arasan-prevent-an-unsupported-configurat.patch queue-5.14/mtd-rawnand-plat_nand-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-mpc5121-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-orion-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-xway-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-rawnand-pasemi-keep-the-driver-compatible-with-on-die-ecc-engines.patch queue-5.14/mtd-core-don-t-remove-debugfs-directory-if-device-is.patch