[PATCH v2] flash_erase: check the nand type

Brian Norris computersforpeace at gmail.com
Thu Oct 24 11:29:51 PDT 2013


On Thu, Oct 24, 2013 at 06:59:51PM +0800, Huang Shijie wrote:
> Now, the MTD_NANDFLASH stands for SLC nand, and the MTD_MLCNANDFLASH
> stands for the MLC nand.
> 
> This patch includes the stdbool.h, and changes the "isNAND" to boolean type,
> and checks the right nand type for the MLC and SLC nand.
> 
> If the user wants to format a MLC nand for JFFS2, we will print out a message
> to warn him, and exit right now.
> 
> Signed-off-by: Huang Shijie <b32955 at freescale.com>

Thanks for the update. Pushed to mtd-utils.git.

BTW, this is not a problem with your patch, but MLC typically have large
OOB sizes which have outgrown the outdated ioctl(MEMGETOOBSEL), so
--jffs2 would have broken for them anyway. I just tested this on my
system. On an old kernel (where MLC is still detected as MTD_NANDFLASH)
I get:

  # flash_erase -j /dev/mtd1 0 1 
  flash_erase: error!: /dev/mtd1: unable to get NAND oobinfo
               error 22 (Invalid argument)

There's not much we can do about this.

Brian



More information about the linux-mtd mailing list