[PATCH v3 5/8] nand: spi: Add bad block support

Peter Pan peterpansjtu at gmail.com
Sun Mar 19 21:49:43 PDT 2017


Hi Arnaud and Boris,

On Fri, Mar 17, 2017 at 8:31 PM, Boris Brezillon
<boris.brezillon at free-electrons.com> wrote:
> On Fri, 17 Mar 2017 13:22:17 +0100
> Arnaud Mouiche <arnaud.mouiche at gmail.com> wrote:
>
>> On 16/03/2017 07:47, Peter Pan wrote:
>> > [...]
>> > +
>> > +/*
>> > + * spinand_scan_bbt - scan BBT in SPI NAND device
>> > + * @chip: SPI NAND device structure
>> > + */
>> > +static int spinand_scan_bbt(struct spinand_device *chip)
>> > +{
>> > +   struct nand_device *nand = &chip->base;
>> > +   int ret;
>> > +
>> > +   nand->bbt.options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
>> > +   nand->bbt.td = NULL;
>> > +   nand->bbt.md = NULL;
>> > +
>> > +   ret = spinand_create_badblock_pattern(chip);
>> > +   if (ret)
>> > +           return ret;
>> > +
>> > +   return nand_scan_bbt(nand);
>> > +}
>> > +
>>
>> Boris, Peter,
>>
>> I'm not a big fan of NAND_BBT_USE_FLASH for small capacity nand flash
>> (eg. 1Gb with 1024 blocks, where a complete bad block scan on boot is
>> fast enough).
>> Do you consider NAND_BBT_USE_FLASH as mandatory, or does a optional
>> "of_get_nand_on_flash_bbt(dn))" device tree configuration is something
>> possible ?
>
> It should be optional indeed.

I agree with you. Let's make it optional.

Thanks,
Peter Pan



More information about the linux-mtd mailing list