Skip to contentSkip to conversation

mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behavior

PATCH New Gregory CLEMENT 3 participants 3 messages Apr 17, 2019 – Apr 27, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behavior

The purpose of "mtd: nand: raw: allow to disable unneeded ECC layouts" was to allow disabling the default ECC layouts if a driver is known to provide its own ECC layout. However, this commit did the opposite and disabled the default layout when it was _not_ selected.

It breaks all the NAND drivers not providing their own ECC layout this patch fix this situation.

It was tested with the lpc32xx_nand_slc driver.

Fixes a38c3af868 ("mtd: nand: raw: allow to disable unneeded ECC layouts")

---
Changelog:
v1 -> v2

- Fix typos in the commit log
- Improve wording as suggested by Miquel
- Add Reviewed-by tag from Miquel

 drivers/mtd/nand/raw/nand_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/nand_base.c +2 -2
index 6d2ff58d86..dc4576a3a1 100644
@@ -47,7 +47,7 @@
 #include <linux/errno.h>
 
 /* Define default oob placement schemes for large and small page devices */
-#ifdef CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT
+#ifndef CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT
 static struct nand_ecclayout nand_oob_8 = {
 	.eccbytes = 3,
 	.eccpos = {0, 1, 2},
@@ -4341,7 +4341,7 @@ int nand_scan_tail(struct mtd_info *mtd)
 	 */
 	if (!ecc->layout && (ecc->mode != NAND_ECC_SOFT_BCH)) {
 		switch (mtd->oobsize) {
-#ifdef CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT
+#ifndef CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT
 		case 8:
 			ecc->layout = &nand_oob_8;
 			break;
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behavior

Quoted 8 lines · Gregory CLEMENT

The purpose of "mtd: nand: raw: allow to disable unneeded ECC layouts" was to allow disabling the default ECC layouts if a driver is known to provide its own ECC layout. However, this commit did the opposite and disabled the default layout when it was _not_ selected.

It breaks all the NAND drivers not providing their own ECC layout this patch fix this situation.

Quoted 6 lines

It was tested with the lpc32xx_nand_slc driver.

Fixes a38c3af868 ("mtd: nand: raw: allow to disable unneeded ECC layouts")

---

Tested on sama5d3_xplained:

This fixes the issue which we found on this board:

NAND: BUG at drivers/mtd/nand/raw/nand_base.c:4361/nand_scan_tail()!

#2 lore raw

PATCH v2 1/1 mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behavior

In reply to Gregory CLEMENT
Quoted 8 lines · Gregory CLEMENT

The purpose of "mtd: nand: raw: allow to disable unneeded ECC layouts" was to allow disabling the default ECC layouts if a driver is known to provide its own ECC layout. However, this commit did the opposite and disabled the default layout when it was _not_ selected.

It breaks all the NAND drivers not providing their own ECC layout this patch fix this situation.

Quoted 6 lines

It was tested with the lpc32xx_nand_slc driver.

Fixes a38c3af868 ("mtd: nand: raw: allow to disable unneeded ECC layouts")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190427/cd747698/attachment.sig>