All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: omap: nand: setup sw ecc size using default value
@ 2013-12-12 12:01 Nikita Kiryanov
  2013-12-12 12:10 ` Gupta, Pekon
  2013-12-12 13:19 ` [U-Boot] [PATCH V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size Nikita Kiryanov
  0 siblings, 2 replies; 6+ messages in thread
From: Nikita Kiryanov @ 2013-12-12 12:01 UTC (permalink / raw)
  To: u-boot

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 <grinberg@compulab.co.il>
Cc: Tom Rini <trini@ti.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Pekon Gupta <pekon@ti.com>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
 drivers/mtd/nand/omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 23a961c..e61788f 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -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;
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] arm: omap: nand: setup sw ecc size using default value
  2013-12-12 12:01 [U-Boot] [PATCH] arm: omap: nand: setup sw ecc size using default value Nikita Kiryanov
@ 2013-12-12 12:10 ` Gupta, Pekon
  2013-12-12 13:16   ` Nikita Kiryanov
  2013-12-12 13:19 ` [U-Boot] [PATCH V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size Nikita Kiryanov
  1 sibling, 1 reply; 6+ messages in thread
From: Gupta, Pekon @ 2013-12-12 12:10 UTC (permalink / raw)
  To: u-boot

Hi Nikita,

Just minor feedback .. 

>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.

[...]
> 		bch_priv.type		= 0;
> 		nand->ecc.mode		= NAND_ECC_SOFT;
> 		nand->ecc.layout	= NULL;
>-		nand->ecc.size		= pagesize;
>+		nand->ecc.size		= 0;
Also, 		nand->ecc.size		= NULL;  is equally readable.. 
(though no issues here)..


with regards, pekon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] arm: omap: nand: setup sw ecc size using default value
  2013-12-12 12:10 ` Gupta, Pekon
@ 2013-12-12 13:16   ` Nikita Kiryanov
  0 siblings, 0 replies; 6+ messages in thread
From: Nikita Kiryanov @ 2013-12-12 13:16 UTC (permalink / raw)
  To: u-boot

On 12/12/2013 02:10 PM, Gupta, Pekon wrote:
> Hi Nikita,
>
> Just minor feedback ..
>
>> 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

>
> [...]
>> 		bch_priv.type		= 0;
>> 		nand->ecc.mode		= NAND_ECC_SOFT;
>> 		nand->ecc.layout	= NULL;
>> -		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.

> (though no issues here)..
>
>
> with regards, pekon
>


-- 
Regards,
Nikita.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size
  2013-12-12 12:01 [U-Boot] [PATCH] arm: omap: nand: setup sw ecc size using default value Nikita Kiryanov
  2013-12-12 12:10 ` Gupta, Pekon
@ 2013-12-12 13:19 ` Nikita Kiryanov
  2013-12-12 13:23   ` Gupta, Pekon
  2013-12-17 23:42   ` [U-Boot] [U-Boot, " Scott Wood
  1 sibling, 2 replies; 6+ messages in thread
From: Nikita Kiryanov @ 2013-12-12 13:19 UTC (permalink / raw)
  To: u-boot

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 <grinberg@compulab.co.il>
Cc: Tom Rini <trini@ti.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Pekon Gupta <pekon@ti.com>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
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(-)

diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 23a961c..e61788f 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -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;
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size
  2013-12-12 13:19 ` [U-Boot] [PATCH V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size Nikita Kiryanov
@ 2013-12-12 13:23   ` Gupta, Pekon
  2013-12-17 23:42   ` [U-Boot] [U-Boot, " Scott Wood
  1 sibling, 0 replies; 6+ messages in thread
From: Gupta, Pekon @ 2013-12-12 13:23 UTC (permalink / raw)
  To: u-boot

>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 <grinberg@compulab.co.il>
>Cc: Tom Rini <trini@ti.com>
>Cc: Scott Wood <scottwood@freescale.com>
>Cc: Pekon Gupta <pekon@ti.com>
>Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
>---
>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(-)
>
>diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
>index 23a961c..e61788f 100644
>--- a/drivers/mtd/nand/omap_gpmc.c
>+++ b/drivers/mtd/nand/omap_gpmc.c
>@@ -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;
>
>--
>1.8.1.2

Acked-by: Pekon Gupta <pekon@ti.com>

with regards, pekon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [U-Boot, V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size
  2013-12-12 13:19 ` [U-Boot] [PATCH V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size Nikita Kiryanov
  2013-12-12 13:23   ` Gupta, Pekon
@ 2013-12-17 23:42   ` Scott Wood
  1 sibling, 0 replies; 6+ messages in thread
From: Scott Wood @ 2013-12-17 23:42 UTC (permalink / raw)
  To: u-boot

On Thu, Dec 12, 2013 at 03:19:31PM +0200, Nikita Kiryanov wrote:
> 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 <grinberg@compulab.co.il>
> Cc: Tom Rini <trini@ti.com>
> Cc: Scott Wood <scottwood@freescale.com>
> Cc: Pekon Gupta <pekon@ti.com>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Acked-by: Pekon Gupta <pekon@ti.com>
> 
> ---
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-17 23:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12 12:01 [U-Boot] [PATCH] arm: omap: nand: setup sw ecc size using default value Nikita Kiryanov
2013-12-12 12:10 ` Gupta, Pekon
2013-12-12 13:16   ` Nikita Kiryanov
2013-12-12 13:19 ` [U-Boot] [PATCH V2] mtd: nand: omap: fix HAM1_SW ecc using default value for ecc.size Nikita Kiryanov
2013-12-12 13:23   ` Gupta, Pekon
2013-12-17 23:42   ` [U-Boot] [U-Boot, " Scott Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.