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

Artem Bityutskiy dedekind1 at gmail.com
Tue Jun 7 01:01:26 EDT 2011


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.

> +	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.

Otherwise the patch looks very good.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list