mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: mrvl-nand: create initial empty bbt
@ 2015-08-09 21:54 Robert Jarzmik
  2015-08-19 14:24 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Jarzmik @ 2015-08-09 21:54 UTC (permalink / raw)
  To: barebox

When creating an initial bad blocks table, create it empty. This is
necessary because when the bad block table blocks are not
initialized (all ff) while some partitions are, all the blocks which
have an OOB data not beginning with 0xff 0xff will be marked as bad
blocks in the initial bad blocks scan.

As a consequence, any existing blocks are impossible to erase
anymore. Fix this by fixing the BBT creation flag.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/mtd/nand/nand_mrvl_nfc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_mrvl_nfc.c b/drivers/mtd/nand/nand_mrvl_nfc.c
index 258ff75..1ec48cc 100644
--- a/drivers/mtd/nand/nand_mrvl_nfc.c
+++ b/drivers/mtd/nand/nand_mrvl_nfc.c
@@ -881,8 +881,9 @@ static int mrvl_nand_scan(struct mtd_info *mtd)
 		 * We'll use a bad block table stored in-flash and don't
 		 * allow writing the bad block marker to the flash.
 		 */
-		chip->bbt_options |= NAND_BBT_USE_FLASH |
-				     NAND_BBT_NO_OOB_BBM;
+		chip->bbt_options |=
+			NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB_BBM |
+			NAND_BBT_CREATE_EMPTY;
 		chip->bbt_td = &bbt_main_descr;
 		chip->bbt_md = &bbt_mirror_descr;
 	}
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] mtd: nand: mrvl-nand: create initial empty bbt
  2015-08-09 21:54 [PATCH] mtd: nand: mrvl-nand: create initial empty bbt Robert Jarzmik
@ 2015-08-19 14:24 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-08-19 14:24 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: barebox

On Sun, Aug 09, 2015 at 11:54:18PM +0200, Robert Jarzmik wrote:
> When creating an initial bad blocks table, create it empty. This is
> necessary because when the bad block table blocks are not
> initialized (all ff) while some partitions are, all the blocks which
> have an OOB data not beginning with 0xff 0xff will be marked as bad
> blocks in the initial bad blocks scan.
> 
> As a consequence, any existing blocks are impossible to erase
> anymore. Fix this by fixing the BBT creation flag.
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  drivers/mtd/nand/nand_mrvl_nfc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2015-08-19 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-09 21:54 [PATCH] mtd: nand: mrvl-nand: create initial empty bbt Robert Jarzmik
2015-08-19 14:24 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox