
Hi Boris,
On 06.08.2018 22:06, Boris Brezillon wrote:
Hi Stefan,
On Mon, 6 Aug 2018 17:12:51 +0200 Stefan Roese sr@denx.de wrote:
It was noticed, that the erase command (mtd erase spi-nand0) aborts upon the first bad block. With this change, bad blocks are now skipped and the erase operation will continue.
That's not what the raw NAND framework does [1], and I'm almost sure MTD users expect erase ops to stop when a bad block is found and "skip bad block" was not explicitly requested.
I see. AFAIR, the default behavior in U-Boot when erasing NAND chips is that bad blocks are skipped though. Thats why I came up with this idea.
I'd suggest moving to an approach where cmd/mtd.c erases blocks one by one and checks the status of each block (with mtd_block_isbad()) before calling mtd_erase(). Alternatively, we could add a 'bool skipbad' field to struct erase_info, but that means getting away from Linux implementation (which is already the case since uboot has an extra "int scrub" field).
Thanks for the suggestions.
I'll double-check all the new "mtd" commands in respect to handling bad blocks again later this week and will try to come up with different approach supporting erase, read and write in the same way.
Thanks, Stefan