[PATCH v3 06/10] mtd: fix the wrong mtd->type for nand chip

Huang Shijie b32955 at freescale.com
Wed Aug 28 03:50:09 EDT 2013


于 2013年08月28日 15:28, Brian Norris 写道:
> All you've shown is the breakage, not the reason for exposing 
> MTD_MLCNANFLASH. There's a difference between MTD_MLCNANDFLASH being 
> in the mtd-abi.h header and actually using it in a driver (and 
> documenting it, and giving it a new sysfs string).
>


Just as you said belowing, the app may calls the MEMGETINFO get the nand 
type(SLC OR MLC).
So after this patch, the app will get the MTD_MLCNANDFLASH type for MLC 
which will is the breakage.

Are'nt the reason for exposing the MTD_MLCNANDFLASH? :(

> There is an alternative: that we don't pass MTD_MLCNANDFLASH through 
> to user-space (we intercept it and change it to MTD_NANDFLASH in 
> ioctl(MEMGETINFO)), and it just appears as "nand" in the sysfs 'type' 
> entry. I'm not saying we should do that--I think it's useful to know 
> SLC vs. MLC in user-space--but I am saying that we need a proper 
> justification. So far I'm the only one who has explained why 
> user-space needs this...
You concern is that exposing the MTD_MLCNANDFLASH may breaks mtd-utils 
or other app tools.

So you suggest to hack the IOCTL(MEMGETINFO) to avoid any changes of the 
apps?

yes, we can use this way to avoid changing the apps, but the side-effect 
is the mtd-utils can not get the
right SLC/MLC info.  If we does do the hack code to the ioctrl, I think 
some one will try to fix the hack code in the future.

thanks
Huang Shijie





More information about the linux-mtd mailing list