[U-Boot] [PATCH] tools/env: check flash length before probing

Mike Frysinger vapier at gentoo.org
Thu Apr 5 19:44:20 CEST 2012


On Thursday 05 April 2012 09:15:12 Bishop, Mark wrote:
> From: Mike Frysinger
> > If we attempt to probe beyond the end of flash, MEMGETBADBLOCK will
> > fail
> > 
> > (as well it should), but we end up erroring out with the distracting:
> > 	Cannot read bad block mark: Invalid argument
> > 
> > Instead of the correct error:
> > 	Too few good blocks within range
> > 
> > Re-order the tests so we check for the end of the flash before probing
> > so we don't probe blocks that don't exist.
> 
> Applied the patch:
> 
> root:/bin> fw_printenv
> Too few good blocks within range

good -- that's what should be displayed.  i had to hack up my local printenv 
for testing against /dev/zero and had to guess at the results :).

> ioctl(3, MEMGETBADBLOCK, [393216])      = 1

this is what we need to root cause.  but let's do it in the existing thread.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120405/8c1365a2/attachment.pgp>


More information about the U-Boot mailing list