[PATCH v5] cmd: mem: fix range of bitflip test

Tom Rini trini at konsulko.com
Sat Sep 19 14:34:39 CEST 2020


On Wed, Sep 09, 2020 at 12:10:00PM -0400, Ralph Siemsen wrote:

> The bitflip test uses two equal sized memory buffers. This is achieved
> by splitting the range of memory into two pieces. The address of the
> second buffer, as well as the length of each buffer, were not correctly
> calculated. This caused bitflip test to access beyond the end of range.
> This patch fixes the pointer arithmetic problem.
> 
> A second problem arises because u-boot "mtest" command expects the
> ending address to be inclusive. When computing (end - start) this
> results in missing 1 byte of the requested length. The bitflip test
> expects a count rather than an "ending" address. Thus it fails to test
> the last word of the requested range. Fixed by using (end - start + 1).
> 
> Added Kconfig option to optionally disable the bitflip test, since it
> does add significantly to the time taken for "mtest".
> 
> Fixes: 8e434cb705d463bc8cff935160e4fb4c77cb99ab ("cmd: mem: Add bitflip
> memory test to alternate mtest")
> 
> Signed-off-by: Ralph Siemsen <ralph.siemsen at linaro.org>
> Reviewed-by: Stefan Roese <sr at denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200919/01a788d1/attachment.sig>


More information about the U-Boot mailing list