linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: brcmnand: fix bch ecc layout for large page nand
@ 2019-04-26 19:22 Kamal Dasu
  2019-05-01 18:35 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Kamal Dasu @ 2019-04-26 19:22 UTC (permalink / raw)
  To: linux-mtd
  Cc: bcm-kernel-feedback-list, linux-kernel, Kamal Dasu, Brian Norris,
	Boris Brezillon, Miquel Raynal, Richard Weinberger,
	David Woodhouse, Marek Vasut

The oobregion->offset for large page nand parts was wrong, change
fixes this error in calculation.

Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 482c6f0..3eefea7 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -939,7 +939,7 @@ static int brcmnand_bch_ooblayout_ecc(struct mtd_info *mtd, int section,
 	if (section >= sectors)
 		return -ERANGE;
 
-	oobregion->offset = (section * (sas + 1)) - chip->ecc.bytes;
+	oobregion->offset = ((section + 1) * sas) - chip->ecc.bytes;
 	oobregion->length = chip->ecc.bytes;
 
 	return 0;
-- 
1.9.0.138.g2de3478


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

* Re: [PATCH] mtd: rawnand: brcmnand: fix bch ecc layout for large page nand
  2019-04-26 19:22 [PATCH] mtd: rawnand: brcmnand: fix bch ecc layout for large page nand Kamal Dasu
@ 2019-05-01 18:35 ` Florian Fainelli
  2019-05-01 19:15   ` Kamal Dasu
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2019-05-01 18:35 UTC (permalink / raw)
  To: Kamal Dasu, linux-mtd
  Cc: Boris Brezillon, Richard Weinberger, linux-kernel, Marek Vasut,
	bcm-kernel-feedback-list, Miquel Raynal, Brian Norris,
	David Woodhouse

On 4/26/19 12:22 PM, Kamal Dasu wrote:
> The oobregion->offset for large page nand parts was wrong, change
> fixes this error in calculation.

Should this have a Fixes tag so this can be backported to stable trees
seemingly automatically? Thanks!

> 
> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> ---
>  drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> index 482c6f0..3eefea7 100644
> --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> @@ -939,7 +939,7 @@ static int brcmnand_bch_ooblayout_ecc(struct mtd_info *mtd, int section,
>  	if (section >= sectors)
>  		return -ERANGE;
>  
> -	oobregion->offset = (section * (sas + 1)) - chip->ecc.bytes;
> +	oobregion->offset = ((section + 1) * sas) - chip->ecc.bytes;
>  	oobregion->length = chip->ecc.bytes;
>  
>  	return 0;
> 


-- 
Florian

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

* Re: [PATCH] mtd: rawnand: brcmnand: fix bch ecc layout for large page nand
  2019-05-01 18:35 ` Florian Fainelli
@ 2019-05-01 19:15   ` Kamal Dasu
  0 siblings, 0 replies; 3+ messages in thread
From: Kamal Dasu @ 2019-05-01 19:15 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Kamal Dasu, MTD Maling List, Boris Brezillon, Richard Weinberger,
	open list, Marek Vasut, bcm-kernel-feedback-list, Miquel Raynal,
	Brian Norris, David Woodhouse

On Wed, May 1, 2019 at 2:35 PM Florian Fainelli <f.fainelli@gmail.com> wrote:
>
> On 4/26/19 12:22 PM, Kamal Dasu wrote:
> > The oobregion->offset for large page nand parts was wrong, change
> > fixes this error in calculation.
>
> Should this have a Fixes tag so this can be backported to stable trees
> seemingly automatically? Thanks!
>

The brcmnand files got moved, however should have the fixes tag, will
send V2 patch.

> >
> > Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> > ---
> >  drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > index 482c6f0..3eefea7 100644
> > --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
> > @@ -939,7 +939,7 @@ static int brcmnand_bch_ooblayout_ecc(struct mtd_info *mtd, int section,
> >       if (section >= sectors)
> >               return -ERANGE;
> >
> > -     oobregion->offset = (section * (sas + 1)) - chip->ecc.bytes;
> > +     oobregion->offset = ((section + 1) * sas) - chip->ecc.bytes;
> >       oobregion->length = chip->ecc.bytes;
> >
> >       return 0;
> >
>
>
> --
> Florian

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

end of thread, other threads:[~2019-05-01 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-26 19:22 [PATCH] mtd: rawnand: brcmnand: fix bch ecc layout for large page nand Kamal Dasu
2019-05-01 18:35 ` Florian Fainelli
2019-05-01 19:15   ` Kamal Dasu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).