All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: atmel: Fix get_sectorsize() function
@ 2018-03-27 17:01 Boris Brezillon
  2018-03-27 18:42   ` Richard Weinberger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-03-27 17:01 UTC (permalink / raw)
  To: Nicolas Ferre, Alexandre Belloni, Boris Brezillon,
	Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
	Olivier Schonken, stable

get_sectorsize() was not using the appropriate macro to extract the
ECC sector size from the config cache, which led to buggy ECC when
using 1024 byte sectors.

Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: <stable@vger.kernel.org>
Reported-by: Olivier Schonken <olivier.schonken@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 drivers/mtd/nand/atmel/pmecc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
index 8268636675ef..4124bf91bee6 100644
--- a/drivers/mtd/nand/atmel/pmecc.c
+++ b/drivers/mtd/nand/atmel/pmecc.c
@@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
 
 static int get_sectorsize(struct atmel_pmecc_user *user)
 {
-	return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512;
+	return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
 }
 
 static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int sector)
-- 
2.14.1

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

* Re: [PATCH] mtd: nand: atmel: Fix get_sectorsize() function
  2018-03-27 17:01 [PATCH] mtd: nand: atmel: Fix get_sectorsize() function Boris Brezillon
@ 2018-03-27 18:42   ` Richard Weinberger
  2018-03-28  8:17 ` Nicolas Ferre
  2018-03-29 17:22 ` Boris Brezillon
  2 siblings, 0 replies; 6+ messages in thread
From: Richard Weinberger @ 2018-03-27 18:42 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Nicolas Ferre, Alexandre Belloni, Miquel Raynal, linux-mtd,
	David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
	Olivier Schonken, stable

Am Dienstag, 27. M�rz 2018, 19:01:58 CEST schrieb Boris Brezillon:
> get_sectorsize() was not using the appropriate macro to extract the
> ECC sector size from the config cache, which led to buggy ECC when
> using 1024 byte sectors.
> 
> Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Cc: <stable@vger.kernel.org>
> Reported-by: Olivier Schonken <olivier.schonken@gmail.com>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
>  drivers/mtd/nand/atmel/pmecc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
> index 8268636675ef..4124bf91bee6 100644
> --- a/drivers/mtd/nand/atmel/pmecc.c
> +++ b/drivers/mtd/nand/atmel/pmecc.c
> @@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
> 
>  static int get_sectorsize(struct atmel_pmecc_user *user)
>  {
> -	return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512;
> +	return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
>  }
> 
>  static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int
> sector)

Reviewed-by: Richard Weinberger <richard@nod.at>

Thanks,
//richard

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

* Re: [PATCH] mtd: nand: atmel: Fix get_sectorsize() function
@ 2018-03-27 18:42   ` Richard Weinberger
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Weinberger @ 2018-03-27 18:42 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Nicolas Ferre, Alexandre Belloni, Miquel Raynal, linux-mtd,
	David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
	Olivier Schonken, stable

Am Dienstag, 27. März 2018, 19:01:58 CEST schrieb Boris Brezillon:
> get_sectorsize() was not using the appropriate macro to extract the
> ECC sector size from the config cache, which led to buggy ECC when
> using 1024 byte sectors.
> 
> Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Cc: <stable@vger.kernel.org>
> Reported-by: Olivier Schonken <olivier.schonken@gmail.com>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
>  drivers/mtd/nand/atmel/pmecc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
> index 8268636675ef..4124bf91bee6 100644
> --- a/drivers/mtd/nand/atmel/pmecc.c
> +++ b/drivers/mtd/nand/atmel/pmecc.c
> @@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
> 
>  static int get_sectorsize(struct atmel_pmecc_user *user)
>  {
> -	return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512;
> +	return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
>  }
> 
>  static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int
> sector)

Reviewed-by: Richard Weinberger <richard@nod.at>

Thanks,
//richard

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

* Re: [PATCH] mtd: nand: atmel: Fix get_sectorsize() function
  2018-03-27 17:01 [PATCH] mtd: nand: atmel: Fix get_sectorsize() function Boris Brezillon
  2018-03-27 18:42   ` Richard Weinberger
@ 2018-03-28  8:17 ` Nicolas Ferre
  2018-03-28  8:24   ` Olivier Schonken
  2018-03-29 17:22 ` Boris Brezillon
  2 siblings, 1 reply; 6+ messages in thread
From: Nicolas Ferre @ 2018-03-28  8:17 UTC (permalink / raw)
  To: Boris Brezillon, Nicolas Ferre, Alexandre Belloni,
	Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
	Olivier Schonken, stable, Tudor Ambarus

On 27/03/2018 at 19:01, Boris Brezillon wrote:
> get_sectorsize() was not using the appropriate macro to extract the
> ECC sector size from the config cache, which led to buggy ECC when
> using 1024 byte sectors.
> 
> Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Cc: <stable@vger.kernel.org>
> Reported-by: Olivier Schonken <olivier.schonken@gmail.com>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Thanks Boris.

Best regards,
   Nicolas

> ---
>   drivers/mtd/nand/atmel/pmecc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
> index 8268636675ef..4124bf91bee6 100644
> --- a/drivers/mtd/nand/atmel/pmecc.c
> +++ b/drivers/mtd/nand/atmel/pmecc.c
> @@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
>   
>   static int get_sectorsize(struct atmel_pmecc_user *user)
>   {
> -	return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512;
> +	return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
>   }
>   
>   static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int sector)
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] mtd: nand: atmel: Fix get_sectorsize() function
  2018-03-28  8:17 ` Nicolas Ferre
@ 2018-03-28  8:24   ` Olivier Schonken
  0 siblings, 0 replies; 6+ messages in thread
From: Olivier Schonken @ 2018-03-28  8:24 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Boris Brezillon, Nicolas Ferre, Alexandre Belloni,
	Richard Weinberger, Miquel Raynal, linux-mtd, David Woodhouse,
	Brian Norris, Marek Vasut, Cyrille Pitchen, stable,
	Tudor Ambarus

On Wed, Mar 28, 2018 at 10:17 AM, Nicolas Ferre
<nicolas.ferre@microchip.com> wrote:
> On 27/03/2018 at 19:01, Boris Brezillon wrote:
>>
>> get_sectorsize() was not using the appropriate macro to extract the
>> ECC sector size from the config cache, which led to buggy ECC when
>> using 1024 byte sectors.
>>
>> Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
>> Cc: <stable@vger.kernel.org>
>> Reported-by: Olivier Schonken <olivier.schonken@gmail.com>
>> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
>
>
> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Thanks Boris.
>
> Best regards,
>   Nicolas
>
>
>> ---
>>   drivers/mtd/nand/atmel/pmecc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nand/atmel/pmecc.c
>> b/drivers/mtd/nand/atmel/pmecc.c
>> index 8268636675ef..4124bf91bee6 100644
>> --- a/drivers/mtd/nand/atmel/pmecc.c
>> +++ b/drivers/mtd/nand/atmel/pmecc.c
>> @@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
>>     static int get_sectorsize(struct atmel_pmecc_user *user)
>>   {
>> -       return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 :
>> 512;
>> +       return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
>>   }
>>     static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user,
>> int sector)
>>
>
>
> --
> Nicolas Ferre

Tested-by: Olivier Schonken <olivier.schonken@gmail.com>
Thanks again.

Regards

Olivier

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

* Re: [PATCH] mtd: nand: atmel: Fix get_sectorsize() function
  2018-03-27 17:01 [PATCH] mtd: nand: atmel: Fix get_sectorsize() function Boris Brezillon
  2018-03-27 18:42   ` Richard Weinberger
  2018-03-28  8:17 ` Nicolas Ferre
@ 2018-03-29 17:22 ` Boris Brezillon
  2 siblings, 0 replies; 6+ messages in thread
From: Boris Brezillon @ 2018-03-29 17:22 UTC (permalink / raw)
  To: Nicolas Ferre, Alexandre Belloni, Boris Brezillon,
	Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: stable, Marek Vasut, Cyrille Pitchen, Olivier Schonken,
	Brian Norris, David Woodhouse

On Tue, 27 Mar 2018 19:01:58 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> get_sectorsize() was not using the appropriate macro to extract the
> ECC sector size from the config cache, which led to buggy ECC when
> using 1024 byte sectors.
> 
> Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
> Cc: <stable@vger.kernel.org>
> Reported-by: Olivier Schonken <olivier.schonken@gmail.com>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

Applied.

> ---
>  drivers/mtd/nand/atmel/pmecc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
> index 8268636675ef..4124bf91bee6 100644
> --- a/drivers/mtd/nand/atmel/pmecc.c
> +++ b/drivers/mtd/nand/atmel/pmecc.c
> @@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
>  
>  static int get_sectorsize(struct atmel_pmecc_user *user)
>  {
> -	return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512;
> +	return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
>  }
>  
>  static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int sector)



-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-03-29 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-27 17:01 [PATCH] mtd: nand: atmel: Fix get_sectorsize() function Boris Brezillon
2018-03-27 18:42 ` Richard Weinberger
2018-03-27 18:42   ` Richard Weinberger
2018-03-28  8:17 ` Nicolas Ferre
2018-03-28  8:24   ` Olivier Schonken
2018-03-29 17:22 ` Boris Brezillon

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.