[PATCH 4/4] flash_info: display MEMGETINFO and MEMISLOCKED

Mike Frysinger vapier at gentoo.org
Tue Jun 7 01:14:05 EDT 2011


On Tue, Jun 7, 2011 at 01:01, Artem Bityutskiy wrote:
> On Mon, 2011-06-06 at 14:22 -0400, Mike Frysinger wrote:
>> I found the existing flash_info output to be a little lacking, so
>> add decoders for MEMGETINFO and MEMISLOCKED.
>>
>> Signed-off-by: Mike Frysinger <vapier at gentoo.org>
>> ---
>>  flash_info.c |   98 +++++++++++++++++++++++++++++++++++++++++++++++++++------
>>  1 files changed, 87 insertions(+), 11 deletions(-)
>
> Pushed patches 1-3.
>
> WRT this patch - I think the sector map should be a separate option,
> because it outputs too much for a default option.

i'm adding regioninfo(-r)/sectormap(-s) as options to mtdinfo so users
get the extended info only when they ask for it

>> +     for (i = 0; i < reginfo->numblocks; ++i) {
>> +             einfo.start = reginfo->offset + i * reginfo->erasesize;
>> +             printf(" %*i: %08x ", width, i, einfo.start);
>> +             if (ioctl(fd, MEMISLOCKED, &einfo))
>> +                     printf("RO ");
>> +             else
>> +                     printf("   ");
>
>
> MEMISLOCKED is quite new ioctl, so you should check for ENOTTY. E.g.,
> with my stock Fedora 14 + nandsim I see all sectors as RO, which is
> obviously not true.

i'll take care of this as i implement regioninfo/islocked in libmtd
-mike



More information about the linux-mtd mailing list