Make NAND_BBT_NO_OOB_BBM configurable or let the gpmi driver decide?

Daniel Glöckner dg at emlix.com
Mon Feb 21 11:00:46 PST 2022


Hi,

we are using UBI on a NAND flash with BBT and have recently observed
bad blocks where nand_markbad_bbm returns an error. Since that error is
returned by nand_block_markbad_lowlevel even when marking the block in
the BBT succeeds, UBI goes into read-only mode. We would therefore like
to set NAND_BBT_NO_OOB_BBM.

Unfortunately there is no device tree property for this flag. Also we
internally disagree if this should be configurable on our platform at
all. We are using an i.MX6 that needs to relocate the bad block marker
to a different byte within the page because of its ECC layout.

In 2014 Lothar already submitted a patch to add a nand-no-oob-bbm device
tree property that got rejected:
https://patchwork.kernel.org/project/linux-arm-kernel/patch/1402579245-13377-5-git-send-email-LW@KARO-electronics.de/
Brian suggested back then to tie this behavior to the non-standard
fsl,no-blockmark-swap property because the marker becomes completely
useless when it stays at the same position as data bytes in good blocks.

So which solution would have the highest chance of being accepted as a
patch? Introducing a device tree property for NAND_BBT_NO_OOB_BBM, using
fsl,no-blockmark-swap, or setting NAND_BBT_NO_OOB_BBM for all boards
inside the i.MX gpmi driver when there is a BBT? Or maybe renaming
fsl,no-blockmark-swap to nand-no-oob-bbm (with a transition phase)?

Best regards,

  Daniel



More information about the linux-mtd mailing list