Message ID | 20200427072453.375642-3-boris.brezillon@collabora.com |
---|---|
State | Changes Requested |
Delegated to: | Miquel Raynal |
Headers | show |
Series | [1/3] mtd: rawnand: Add a NAND_NO_BBM_QUIRK flag | expand |
Hi Boris, Boris Brezillon <boris.brezillon@collabora.com> wrote on Mon, 27 Apr 2020 09:24:53 +0200: > We have a dummy block_bad() implementation returning 0. Let's set the > NAND_NO_BBM_QUIRK flag and let the core take care of that. > > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> > --- > drivers/mtd/nand/raw/diskonchip.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/drivers/mtd/nand/raw/diskonchip.c b/drivers/mtd/nand/raw/diskonchip.c > index c2a391ad2c35..4c3d04da4cee 100644 > --- a/drivers/mtd/nand/raw/diskonchip.c > +++ b/drivers/mtd/nand/raw/diskonchip.c > @@ -776,13 +776,6 @@ static int doc200x_dev_ready(struct nand_chip *this) > } > } > > -static int doc200x_block_bad(struct nand_chip *this, loff_t ofs) > -{ > - /* This is our last resort if we couldn't find or create a BBT. Just > - pretend all blocks are good. */ > - return 0; > -} > - > static void doc200x_enable_hwecc(struct nand_chip *this, int mode) > { > struct doc_priv *doc = nand_get_controller_data(this); > @@ -1578,7 +1571,6 @@ static int __init doc_probe(unsigned long physadr) > nand->legacy.cmd_ctrl = doc200x_hwcontrol; > nand->legacy.dev_ready = doc200x_dev_ready; > nand->legacy.waitfunc = doc200x_wait; > - nand->legacy.block_bad = doc200x_block_bad; > nand->ecc.hwctl = doc200x_enable_hwecc; > nand->ecc.calculate = doc200x_calculate_ecc; > nand->ecc.correct = doc200x_correct_data; > @@ -1590,7 +1582,7 @@ static int __init doc_probe(unsigned long physadr) > nand->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK; > nand->bbt_options = NAND_BBT_USE_FLASH; > /* Skip the automatic BBT scan so we can run it manually */ > - nand->options |= NAND_SKIP_BBTSCAN; > + nand->options |= NAND_SKIP_BBTSCAN | NAND_NO_BBM_QUIRK; > > doc->physadr = physadr; > doc->virtadr = virtadr; Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Thanks, Miquèl
diff --git a/drivers/mtd/nand/raw/diskonchip.c b/drivers/mtd/nand/raw/diskonchip.c index c2a391ad2c35..4c3d04da4cee 100644 --- a/drivers/mtd/nand/raw/diskonchip.c +++ b/drivers/mtd/nand/raw/diskonchip.c @@ -776,13 +776,6 @@ static int doc200x_dev_ready(struct nand_chip *this) } } -static int doc200x_block_bad(struct nand_chip *this, loff_t ofs) -{ - /* This is our last resort if we couldn't find or create a BBT. Just - pretend all blocks are good. */ - return 0; -} - static void doc200x_enable_hwecc(struct nand_chip *this, int mode) { struct doc_priv *doc = nand_get_controller_data(this); @@ -1578,7 +1571,6 @@ static int __init doc_probe(unsigned long physadr) nand->legacy.cmd_ctrl = doc200x_hwcontrol; nand->legacy.dev_ready = doc200x_dev_ready; nand->legacy.waitfunc = doc200x_wait; - nand->legacy.block_bad = doc200x_block_bad; nand->ecc.hwctl = doc200x_enable_hwecc; nand->ecc.calculate = doc200x_calculate_ecc; nand->ecc.correct = doc200x_correct_data; @@ -1590,7 +1582,7 @@ static int __init doc_probe(unsigned long physadr) nand->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK; nand->bbt_options = NAND_BBT_USE_FLASH; /* Skip the automatic BBT scan so we can run it manually */ - nand->options |= NAND_SKIP_BBTSCAN; + nand->options |= NAND_SKIP_BBTSCAN | NAND_NO_BBM_QUIRK; doc->physadr = physadr; doc->virtadr = virtadr;
We have a dummy block_bad() implementation returning 0. Let's set the NAND_NO_BBM_QUIRK flag and let the core take care of that. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> --- drivers/mtd/nand/raw/diskonchip.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)