Skip to contentSkip to conversation

mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behaviour

PATCH Superseded Gregory CLEMENT 2 participants 3 messages Apr 17, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behaviour

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 disbaled the default layout whqant it was _not_ selectec.

It breaks all the driver nand that not providing their ecc layout, this patch fix this sitution.

It was tested with the lpc32xx_nand_slc driver.

Fixes a38c3af868 ("mtd: nand: raw: allow to disable unneeded ECC layouts")
---
 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
maintainer
#1 lore raw

PATCH 1/1 mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behaviour

Hi Gregory,

Gregory CLEMENT <[email protected]> wrote on Wed, 17 Apr 2019 11:09:42 +0200:

Quoted 4 lines

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 disbaled the default layout whqant it was _not_ selectec.

when selected

Quoted 2 lines

It breaks all the driver nand that not providing their ecc layout, this

What about "It breaks all the NAND drivers not providing their own ECC layout".

Quoted 1 line

patch fix this sitution.

situation

Quoted 6 lines

It was tested with the lpc32xx_nand_slc driver.

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

---

I missed that mistake in my original review. Thanks for fixing it.

With above typos fixed:

Quoted 17 lines
 drivers/mtd/nand/raw/nand_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/nand_base.c +1 -1
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},

drivers/mtd/nand/raw/nand_base.c int nand_scan_tail(struct mtd_info *mtd) · line 4347

Quoted 8 lines
drivers/mtd/nand/raw/nand_base.c +1 -1
@@ -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;

Thanks,
Miquèl

#2 lore raw

PATCH 1/1 mtd: nand: raw: Fix CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT behaviour

Miquel Raynal <[email protected]> writes:

Hi Miquel,

Quoted 29 lines

Hi Gregory,

Gregory CLEMENT <[email protected]> wrote on Wed, 17 Apr 2019 11:09:42 +0200:

Quoted 4 lines

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 disbaled the default layout whqant it was _not_ selectec.

when selected

Quoted 2 lines

It breaks all the driver nand that not providing their ecc layout, this

What about "It breaks all the NAND drivers not providing their own ECC layout".

Quoted 1 line

patch fix this sitution.

situation

Quoted 6 lines

It was tested with the lpc32xx_nand_slc driver.

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

---

Quoted 5 lines

I missed that mistake in my original review. Thanks for fixing it.

With above typos fixed:

Thanks I've just sent a v2 with the typo fixed and the new wording as well as a another typo fix in the topic.

Thanks,

Gregory

Quoted 29 lines
Quoted 18 lines
 drivers/mtd/nand/raw/nand_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/nand_base.c +1 -1
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},

drivers/mtd/nand/raw/nand_base.c int nand_scan_tail(struct mtd_info *mtd) · line 4347

Quoted 8 lines
drivers/mtd/nand/raw/nand_base.c +1 -1
@@ -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;

Thanks,
Miquèl

Signature · 3 lines
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com