Skip to contentSkip to conversation

arm: omap: nand: setup sw ecc size using default value

PATCH New Nikita Kiryanov 3 participants 6 messages Dec 12, 2013 – Dec 17, 2013

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

PATCH 1/1 arm: omap: nand: setup sw ecc size using default value

Commit "mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform" (d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way software ECC is configured, both during boot, and during ecc switch, in a way that is not backwards compatible with older systems:

Older version of omap_gpmc.c always assigned ecc.size = 0 when configuring for software ecc, relying on nand_scan_tail() to select a default for ecc.size (256), while the new version of omap_gpmc.c assigns ecc.size = pagesize, which is likely to not be 256.

Since 1 bit hamming sw ecc is only meant to be used by legacy devices, revert to the original behavior.

Cc Igor Grinberg <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott Wood <[email protected]>
Cc Pekon Gupta <[email protected]>
---
 drivers/mtd/nand/omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/omap_gpmc.c +1 -1
index 23a961c..e61788f 100644
@@ -774,7 +774,7 @@ static int omap_select_ecc_scheme(struct nand_chip *nand,
 		bch_priv.type		= 0;
 		nand->ecc.mode		= NAND_ECC_SOFT;
 		nand->ecc.layout	= NULL;
-		nand->ecc.size		= pagesize;
+		nand->ecc.size		= 0;
 		bch->ecc_scheme		= OMAP_ECC_HAM1_CODE_SW;
 		break;
 
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 arm: omap: nand: setup sw ecc size using default value

Hi Nikita,

Just minor feedback ..

Quoted 3 lines

From: Nikita Kiryanov [mailto:nikita at compulab.co.il]
Subject: [PATCH] arm: omap: nand: setup sw ecc size using default value

Just include ""mtd: nand: omap: fix HAM1_SW" ... as prefix to your patch title.
Example: "mtd: nand: omap: fix HAM1_SW using default setup to assign ecc.size" This is helpful while cherry picking patches, As patch title gives some knowledge of what patch does, and what all it touches.

[...]

drivers/mtd/nand/omap_gpmc.c static int omap_select_ecc_scheme(struct nand_chip *nand, · line 777

Quoted 5 lines
		bch_priv.type		= 0;
		nand->ecc.mode		= NAND_ECC_SOFT;
		nand->ecc.layout	= NULL;
drivers/mtd/nand/omap_gpmc.c +1 -1
-		nand->ecc.size		= pagesize;
+		nand->ecc.size		= 0;

Also, nand->ecc.size = NULL; is equally readable..
(though no issues here)..

with regards, pekon

#2 lore raw

PATCH 1/1 arm: omap: nand: setup sw ecc size using default value

Quoted 11 lines · Pekon

Hi Nikita,

Just minor feedback ..

Quoted 3 lines

From: Nikita Kiryanov [mailto:nikita at compulab.co.il]
Subject: [PATCH] arm: omap: nand: setup sw ecc size using default value

Just include ""mtd: nand: omap: fix HAM1_SW" ... as prefix to your patch title.
Example: "mtd: nand: omap: fix HAM1_SW using default setup to assign ecc.size" This is helpful while cherry picking patches, As patch title gives some knowledge of what patch does, and what all it touches.

OK I'll incorporate this into the title

Quoted 8 lines

[...]

drivers/mtd/nand/omap_gpmc.c static int omap_select_ecc_scheme(struct nand_chip *nand, · line 777

Quoted 5 lines
		bch_priv.type		= 0;
		nand->ecc.mode		= NAND_ECC_SOFT;
		nand->ecc.layout	= NULL;
drivers/mtd/nand/omap_gpmc.c +1 -1
-		nand->ecc.size		= pagesize;
+		nand->ecc.size		= 0;

Also, nand->ecc.size = NULL; is equally readable..

I know the result is the same, but conceptually this is not correct. ecc.size is an int, not a pointer.

Quoted 5 lines

(though no issues here)..

with regards, pekon

Signature · 2 lines
Regards,
Nikita.
#3 lore raw

PATCH v2 1/1 mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size

In reply to Nikita Kiryanov

Commit "mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform" (d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way software ECC is configured, both during boot, and during ecc switch, in a way that is not backwards compatible with older systems:

Older version of omap_gpmc.c always assigned ecc.size = 0 when configuring for software ecc, relying on nand_scan_tail() to select a default for ecc.size (256), while the new version of omap_gpmc.c assigns ecc.size = pagesize, which is likely to not be 256.

Since 1 bit hamming sw ecc is only meant to be used by legacy devices, revert to the original behavior.

Cc Igor Grinberg <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott Wood <[email protected]>
Cc Pekon Gupta <[email protected]>

---
Changes in V2:
- reworded commit title to better reflect what is being affected (Pekon Gupta)

 drivers/mtd/nand/omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/omap_gpmc.c +1 -1
index 23a961c..e61788f 100644
@@ -774,7 +774,7 @@ static int omap_select_ecc_scheme(struct nand_chip *nand,
 		bch_priv.type		= 0;
 		nand->ecc.mode		= NAND_ECC_SOFT;
 		nand->ecc.layout	= NULL;
-		nand->ecc.size		= pagesize;
+		nand->ecc.size		= 0;
 		bch->ecc_scheme		= OMAP_ECC_HAM1_CODE_SW;
 		break;
 
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH v2 1/1 mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size

Quoted 41 lines

From: Nikita Kiryanov [mailto:nikita at compulab.co.il]
Commit "mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform" (d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way software ECC is configured, both during boot, and during ecc switch, in a way that is not backwards compatible with older systems:

Older version of omap_gpmc.c always assigned ecc.size = 0 when configuring for software ecc, relying on nand_scan_tail() to select a default for ecc.size (256), while the new version of omap_gpmc.c assigns ecc.size = pagesize, which is likely to not be 256.

Since 1 bit hamming sw ecc is only meant to be used by legacy devices, revert to the original behavior.

Cc Igor Grinberg <[email protected]>
Cc Tom Rini <[email protected]>
Cc Scott Wood <[email protected]>
Cc Pekon Gupta <[email protected]>

---
Changes in V2:
- reworded commit title to better reflect what is being affected (Pekon Gupta)

drivers/mtd/nand/omap_gpmc.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/omap_gpmc.c +1 -2
index 23a961c..e61788f 100644
@@ -774,7 +774,7 @@ static int omap_select_ecc_scheme(struct nand_chip *nand,
 		bch_priv.type		= 0;
 		nand->ecc.mode		= NAND_ECC_SOFT;
 		nand->ecc.layout	= NULL;
-		nand->ecc.size		= pagesize;
+		nand->ecc.size		= 0;
 		bch->ecc_scheme		= OMAP_ECC_HAM1_CODE_SW;
 		break;
 
--
Quoted 1 line

1.8.1.2

with regards, pekon

#5 lore raw

PATCH v2 1/1 mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size

In reply to Nikita Kiryanov
Quoted 20 lines · Nikita Kiryanov

Commit "mtd: nand: omap: enable BCH ECC scheme using ELM for generic platform" (d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way software ECC is configured, both during boot, and during ecc switch, in a way that is not backwards compatible with older systems:

Older version of omap_gpmc.c always assigned ecc.size = 0 when configuring for software ecc, relying on nand_scan_tail() to select a default for ecc.size (256), while the new version of omap_gpmc.c assigns ecc.size = pagesize, which is likely to not be 256.

Since 1 bit hamming sw ecc is only meant to be used by legacy devices, revert to the original behavior.

Quoted 7 lines

---
Changes in V2:
- reworded commit title to better reflect what is being affected (Pekon Gupta)

 drivers/mtd/nand/omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-nand-flash.git

-Scott