diff mbox

[U-Boot,2/3] nand: Fix nand_erase_opts() offset check

Message ID 832918479.587458.1352146575747.JavaMail.root@advansee.com
State Accepted
Delegated to: Scott Wood
Headers show

Commit Message

Benoît Thébaudeau Nov. 5, 2012, 8:16 p.m. UTC
NAND Flash is erased by blocks, not by pages.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
---
 .../drivers/mtd/nand/nand_util.c                                   |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Scott Wood Nov. 16, 2012, 12:23 a.m. UTC | #1
On Mon, Nov 05, 2012 at 10:16:15AM -0000, =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau_=3Cbenoit=2Ethebaudeau=40advans?==?utf-8?q?ee=2Ecom=3E?= wrote:
> NAND Flash is erased by blocks, not by pages.
> 
> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> Cc: Scott Wood <scottwood@freescale.com>

Applied to u-boot-nand-flash

-Scott
Benoît Thébaudeau Nov. 19, 2012, 8:40 p.m. UTC | #2
Dear Scott Wood,

On Friday, November 16, 2012 1:23:20 AM, Scott Wood wrote:
> On Mon, Nov 05, 2012 at 10:16:15AM -0000,
> =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau_=3Cbenoit=2Ethebaudeau=40advans?==?utf-8?q?ee=2Ecom=3E?=
> wrote:
> > NAND Flash is erased by blocks, not by pages.
> > 
> > Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> > Cc: Scott Wood <scottwood@freescale.com>
> 
> Applied to u-boot-nand-flash

Thanks.

I still don't see it on gitweb. Usually, this takes at most a few hours. Is
there a mirror sync issue or something? Unless this is a manual operation for
you?

Best regards,
Benoît
Scott Wood Nov. 19, 2012, 8:51 p.m. UTC | #3
On 11/19/2012 02:40:31 PM, Benoît Thébaudeau wrote:
> Dear Scott Wood,
> 
> On Friday, November 16, 2012 1:23:20 AM, Scott Wood wrote:
> > On Mon, Nov 05, 2012 at 10:16:15AM -0000,
> >  
> =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau_=3Cbenoit=2Ethebaudeau=40advans?==?utf-8?q?ee=2Ecom=3E?=
> > wrote:
> > > NAND Flash is erased by blocks, not by pages.
> > >
> > > Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> > > Cc: Scott Wood <scottwood@freescale.com>
> >
> > Applied to u-boot-nand-flash
> 
> Thanks.
> 
> I still don't see it on gitweb. Usually, this takes at most a few  
> hours. Is
> there a mirror sync issue or something? Unless this is a manual  
> operation for
> you?

I'm waiting to get an ack from Andy for the mpc85xx bits before I push  
my tree, lest I have history that needs changing.

-Scott
diff mbox

Patch

diff --git u-boot-nand-flash-9c60e75.orig/drivers/mtd/nand/nand_util.c u-boot-nand-flash-9c60e75/drivers/mtd/nand/nand_util.c
index 3f11103..2855683 100644
--- u-boot-nand-flash-9c60e75.orig/drivers/mtd/nand/nand_util.c
+++ u-boot-nand-flash-9c60e75/drivers/mtd/nand/nand_util.c
@@ -80,8 +80,8 @@  int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
 	struct mtd_oob_ops oob_opts;
 	struct nand_chip *chip = meminfo->priv;
 
-	if ((opts->offset & (meminfo->writesize - 1)) != 0) {
-		printf("Attempt to erase non page-aligned data\n");
+	if ((opts->offset & (meminfo->erasesize - 1)) != 0) {
+		printf("Attempt to erase non block-aligned data\n");
 		return -1;
 	}