From ff58aaf0bb23129c81099c3b2ea89954022bf6cf Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 26 Oct 2016 17:18:44 -0700 Subject: nand: force BBT scan for controllers which need it Commit 35c204d8a9d0 ("nand: reinstate lazy bad block scanning") introduced lazy BBT scanning. However, some controller do parts of the initialization (mxs_nand.c) during scan_bbt, hence for those controllers the BBT must be scanned at initialization time. In most situation the U-Boot environment gets read first, and the U-Boot environment code checks for bad blocks first. Checking for bad blocks will ask for scan_bbt before reading the first page, hence in most situation the issue does not appear in practice. However, when there is no environment configured, other code might access NAND first which does not explicitly checks for bad blocks, in those cases ECC reads will fail always. Cc: Rostislav Lisovy Signed-off-by: Stefan Agner Acked-by: Max Krummenacher --- include/linux/mtd/nand.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index d55807b2e2..d93989663b 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -224,6 +224,8 @@ typedef enum { * kmap'ed, vmalloc'ed highmem buffers being passed from upper layers */ #define NAND_USE_BOUNCE_BUFFER 0x00100000 +/* Chip needs BBT scan */ +#define NAND_NEED_BBTSCAN 0x00200000 /* Options set by nand scan */ /* bbt has already been read */ -- cgit v1.2.3