From: Mike Frysinger Date: Thu, 5 Apr 2012 13:44:20 -0400 Subject: [U-Boot] [PATCH] tools/env: check flash length before probing In-Reply-To: <5D308BD40154E4439D82454FE483A502066195D9@EVS4.nam.ci.root> References: <1333603758-26498-1-git-send-email-vapier@gentoo.org> <5D308BD40154E4439D82454FE483A502066195D9@EVS4.nam.ci.root> Message-ID: <201204051344.21632.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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: