Query mtd-utils v1.4.9 : flash_erase.c

Brian Norris computersforpeace at gmail.com
Fri Apr 6 20:52:01 EDT 2012

On Thu, Apr 5, 2012 at 5:44 PM, Kushwaha Prabhakar-B32579
<B32579 at freescale.com> wrote:
>> -----Original Message-----
>> From: Brian Norris [mailto:computersforpeace at gmail.com]
>> On Thu, Apr 5, 2012 at 2:21 AM, Kushwaha Prabhakar-B32579 <B32579 at freescale.com> wrote:
>> >  I checked latest mtd-utils ver 1.4.9 for file flash_erase.c.
>> >
>> > It usage MEMGETOOBSEL ioctl to get OOB information from the driver. But
>> this ioctl may returns error for big NAND chips.
>> > The reason of failure would be the following condition at
>> > linux/driver/mtd/mtdchar.c
>> >  if (mtd->ecclayout->eccbytes > ARRAY_SIZE(oi.eccpos))
>> >
>> > MEMGETOOBSEL has been obsolete. then Why mtd-utils still using it.
>> A few reasons:
>> (1) There is no replacement interface and there is no plan for a
>> replacement AFAIK (unless you count MTD_OOB_AUTO within the kernel, as
>> you mention).
>> (2) It's only used for the legacy option JFFS2 format option (-j or --
>> jffs2). JFFS2 isn't supported much anymore, and it probably is not worth
>> using on "big NAND chips." On some systems, ECC does not even leave
>> enough room in OOB for JFFS2.
> Looks like mtd-utils is no more interested in supporting jffs2 for big NAND chips.
> Going forward,  ubifs is the File system for NAND chips supported by mtd-utils??

Personally, I only work with UBIFS.

>> > Also, I don't think flash_erase.c supports MTD_OOB_AUTO. Although its
>> support is already part of Linux kernel.
>> What do you mean by "support MTD_OOB_AUTO" (this is actually renamed
>> MTD_OPS_AUTO_OOB, btw)? If you're speaking of the -j option still, then
>> it's probably because nobody has bothered supporting old features on new
>> userspace tools with new (large-OOB) chips. This would require a
>> developer who cares about JFFS2 to compare the various versions of
>> "autoplace." It wouldn't be too hard to make this use MTD_OPS_AUTO_OOB; I
>> just haven't studied auto/jffs2 much...
> Means, If I want to use, I have to make local changes in mtd-utils :(

Not exactly. If you are such a developer who cares about JFFS2 and
will do a little bit of necessary work, then we can integrate your
"local changes" into mtd-utils (provided, of course, they pass some
amount of review). This is open source! As I said, I could probably
write such patches, but I'm not testing JFFS2.

> Is there any plan to support MTD_OPS_AUTO_OOB in future in-case somebody send patch?

At this point, I'd hope others might speak up. Personally, I don't see
why we couldn't accept patch(es) if they are reviewed and tested
properly. I don't know of a "plan."


More information about the linux-mtd mailing list