All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix wrong memory limit calculation in memory-test
Date: Thu, 07 Feb 2008 13:54:21 -0500	[thread overview]
Message-ID: <47AB53DD.3030007@ge.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802071735120.5383@axis700.grange>

Guennadi Liakhovetski wrote:
> If the length of the memory address range passed to the "mtest" command is 
> not of the form 2^x - 1, not all address lines are tested. This bug is 
> inherited from the original software at 
> http://www.netrino.com/Embedded-Systems/How-To/Memory-Test-Suite-C. Fix 
> this.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> 
> ---
> 
> diff --git a/common/cmd_mem.c b/common/cmd_mem.c
> index a994211..2b55e7e 100644
> --- a/common/cmd_mem.c
> +++ b/common/cmd_mem.c
> @@ -661,7 +661,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>  	ulong	readback;
>  
>  #if defined(CFG_ALT_MEMTEST)
> -	vu_long	addr_mask;
> +	vu_long	len;
>  	vu_long	offset;
>  	vu_long	test_offset;
>  	vu_long	pattern;
> @@ -800,24 +800,24 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>  		 * Returns:     0 if the test succeeds, 1 if the test fails.
>  		 *

The "## NOTE ##" doesn't really apply any more.  Besides that, generally 
"start" and "end" are constrained by the system (hardware and software 
configuration) so "picking" them is a nebulous concept.  I would simply 
delete the note.

>  		 * ## NOTE ##	Be sure to specify start and end
> -		 *              addresses such that addr_mask has
> +		 *              addresses such that len has
>  		 *              lots of bits set. For example an
>  		 *              address range of 01000000 02000000 is
>  		 *              bad while a range of 01000000
>  		 *              01ffffff is perfect.
>  		 */
> -		addr_mask = ((ulong)end - (ulong)start)/sizeof(vu_long);
> +		len = ((ulong)end - (ulong)start)/sizeof(vu_long);
>  		pattern = (vu_long) 0xaaaaaaaa;
>  		anti_pattern = (vu_long) 0x55555555;
>  
>  		PRINTF("%s:%d: addr mask = 0x%.8lx\n",

s/addr mask/len/ in the printf() string

>  			__FUNCTION__, __LINE__,
> -			addr_mask);
> +			len);

Otherwise, good!

Thanks,
gvb

  reply	other threads:[~2008-02-07 18:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 16:40 [U-Boot-Users] [PATCH] Fix wrong memory limit calculation in memory-test Guennadi Liakhovetski
2008-02-07 18:54 ` Jerry Van Baren [this message]
2008-02-08 20:25   ` [U-Boot-Users] [PATCH v2] " Guennadi Liakhovetski
2008-02-14 23:51     ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47AB53DD.3030007@ge.com \
    --to=gerald.vanbaren@ge.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.