[PATCH v3 3/6] mtd: set the ecc step size for master/slave mtd_info

Brian Norris computersforpeace at gmail.com
Sat Aug 17 14:58:04 EDT 2013


On Tue, Aug 13, 2013 at 04:29:46AM +0000, Gupta, Pekon wrote:
> > On Mon, Aug 12, 2013 at 05:44:57PM +0800, Huang Shijie wrote:
> > > 于 2013年08月12日 17:24, Gupta, Pekon 写道:
> > > >In addition, chip->ecc.bytes should also be helpful for userspace
> > > >utility to determine how much bytes to reserve in spare-area for ECC.
> > > >So exposing that as sysfs entry is also good.
> > > >
> > > I do not need the chip->ecc.bytes. :)
> > > For me, export the chip->ecc.size is enough.
> > 
> > A better argument against this is that ecc.bytes does not necessarily
> > have utility across many types of NAND drivers by itself, since ECC
> > layouts differ. And at that point, we're trying to duplicate the
> > behavior of ioctl(ECCGETLAYOUT) (which notably has run out of room and
> > isn't 100% informative anymore).
> > 
> > > So you can submit a patch if you need this field.
> > 
> > Yes, if you have good reason for exporting it, send a patch and a good
> > argument. And it would need to explain why we can't just use
> > ECCGETLAYOUT.
> > 
> Thanks for the info..
> I wasn't fully aware of ioctl(ECCGETLAYOUT), I'll explore it further.

Just to be clear, there may be good reason to duplicate features between
ECCGETLAYOUT and sysfs (for instance, because we've grown beyond the
size of ECCGETLAYOUT, or simply so that modern, useful parameters are
all in one place).

> Also, is there any documentation or URL explaining all ioctl for MTD?

That's a good question. As far as I know, the best reference is
include/uapi/mtd/mtd-abi.h. There's some old documentation for UBI
ioctls on:

  http://linux-mtd.infradead.org/
  http://linux-mtd.infradead.org/doc/ubidesign/ubidesign.pdf

I don't really see anything like that for MTD. But you are free to write
up such documentation! You can send patches against mtd-www.git:

  http://linux-mtd.infradead.org/faq/general.html#L_mtdwww

Or perhaps we could use something within the kernel Documentation/mtd/
directory? I would consult Artem/David for that one.

Brian



More information about the linux-mtd mailing list