aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/nand_micron.c
diff options
context:
space:
mode:
authorPiotr Sroka <piotrs@cadence.com>2019-09-24 06:54:31 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2019-10-04 18:02:20 +0200
commita3c4c2339f8948b0f578e938970303a7372e60c0 (patch)
treed7f8aff16b3f69351930e1e983920980e7556829 /drivers/mtd/nand/raw/nand_micron.c
parentmtd: nand: brcmnand: Add support for flash-dma v0 (diff)
downloadlinux-dev-a3c4c2339f8948b0f578e938970303a7372e60c0.tar.xz
linux-dev-a3c4c2339f8948b0f578e938970303a7372e60c0.zip
mtd: rawnand: Change calculating of position page containing BBM
Change calculating of position page containing BBM If none of BBM flags are set then function nand_bbm_get_next_page reports EINVAL. It causes that BBM is not read at all during scanning factory bad blocks. The result is that the BBT table is build without checking factory BBM at all. For Micron flash memories none of these flags are set if page size is different than 2048 bytes. Address this regression by: - adding NAND_BBM_FIRSTPAGE chip flag without any condition. It solves issue only for Micron devices. - changing the nand_bbm_get_next_page_function. It will return 0 if no of BBM flag is set and page parameter is 0. After that modification way of discovering factory bad blocks will work similar as in kernel version 5.1. Cc: stable@vger.kernel.org Fixes: f90da7818b14 (mtd: rawnand: Support bad block markers in first, second or last page) Signed-off-by: Piotr Sroka <piotrs@cadence.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd/nand/raw/nand_micron.c')
-rw-r--r--drivers/mtd/nand/raw/nand_micron.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c
index 8ca9fad6e6ad..56654030ec7f 100644
--- a/drivers/mtd/nand/raw/nand_micron.c
+++ b/drivers/mtd/nand/raw/nand_micron.c
@@ -446,8 +446,10 @@ static int micron_nand_init(struct nand_chip *chip)
if (ret)
goto err_free_manuf_data;
+ chip->options |= NAND_BBM_FIRSTPAGE;
+
if (mtd->writesize == 2048)
- chip->options |= NAND_BBM_FIRSTPAGE | NAND_BBM_SECONDPAGE;
+ chip->options |= NAND_BBM_SECONDPAGE;
ondie = micron_supports_on_die_ecc(chip);