[PATCH] [MTD] [NAND]: nand_default_mark_blockbad() doesn't work when flash-based bbt not enabled

Ricard Wanderlof ricard.wanderlof at axis.com
Fri Oct 20 11:36:35 EDT 2006


Hi,

When a flash-based BBT is not used, nand_default_mark_blockbad() is 
supposed to mark the block bad in the oob. However, it sets the wrong 
length variable so that no bad block marker is in fact written. This patch 
attempts to rectify that.

From: Ricard Wanderlof <ricardw at axis.com>
Signed-off-by: Ricard Wanderlof <ricardw at axis.com>

diff -ur git/drivers/mtd/nand/nand_base.c rw/drivers/mtd/nand/nand_base.c
--- git/drivers/mtd/nand/nand_base.c	2006-10-20 17:23:37.000000000 +0200
+++ rw/drivers/mtd/nand/nand_base.c	2006-10-20 17:23:56.000000000 +0200
@@ -362,7 +362,7 @@
  		 * access
  		 */
  		ofs += mtd->oobsize;
-		chip->ops.len = 2;
+		chip->ops.ooblen = 2;
  		chip->ops.datbuf = NULL;
  		chip->ops.oobbuf = buf;
  		chip->ops.ooboffs = chip->badblockpos & ~0x01;

--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30
-------------- next part --------------
diff -ur git/drivers/mtd/nand/nand_base.c rw/drivers/mtd/nand/nand_base.c
--- git/drivers/mtd/nand/nand_base.c	2006-10-20 17:23:37.000000000 +0200
+++ rw/drivers/mtd/nand/nand_base.c	2006-10-20 17:23:56.000000000 +0200
@@ -362,7 +362,7 @@
 		 * access
 		 */
 		ofs += mtd->oobsize;
-		chip->ops.len = 2;
+		chip->ops.ooblen = 2;
 		chip->ops.datbuf = NULL;
 		chip->ops.oobbuf = buf;
 		chip->ops.ooboffs = chip->badblockpos & ~0x01;


More information about the linux-mtd mailing list