diff mbox

[U-Boot] mtest: Disable dcache during test

Message ID 201208111615.17567.vapier@gentoo.org
State Rejected
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Mike Frysinger Aug. 11, 2012, 8:15 p.m. UTC
On Saturday 11 August 2012 16:05:36 Benoît Thébaudeau wrote:
> On 08/11/2012 21:47, Andrew Dyer wrote:
> > I agree with Mike, use the current dcache settings. U-boot has always
> > assumed the user knew what they were doing.
> > If you want to print a small message with the dcache setting that
> > makes sense to me, but no big warning.
> 
> Then, something like the following at runtime in the first lines printed my
> mtest?
> 
> dcache state: on

i'd be fine with that.  something like below (if you want to test & post,
that'd be good).
-mike

Comments

Benoît Thébaudeau Aug. 11, 2012, 8:25 p.m. UTC | #1
On Saturday 11 August 2012 22:15:16 Mike Frysinger wrote:
> On Saturday 11 August 2012 16:05:36 Benoît Thébaudeau wrote:
> > On 08/11/2012 21:47, Andrew Dyer wrote:
> > > I agree with Mike, use the current dcache settings. U-boot has
> > > always
> > > assumed the user knew what they were doing.
> > > If you want to print a small message with the dcache setting that
> > > makes sense to me, but no big warning.
> > 
> > Then, something like the following at runtime in the first lines
> > printed my
> > mtest?
> > 
> > dcache state: on
> 
> i'd be fine with that.  something like below (if you want to test &
> post,
> that'd be good).
> -mike
> 
> diff --git a/common/cmd_mem.c b/common/cmd_mem.c
> index 18f0a3f..5628f6a 100644
> --- a/common/cmd_mem.c
> +++ b/common/cmd_mem.c
> @@ -651,8 +651,10 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag,
> int argc, char * const argv[])
>  	else
>  		iteration_limit = 0;
>  
> +	printf("Testing %08x ... %08x (dcache: %s):\n", (uint)start,
> (uint)end,
> +		dcache_status() ? "on" : "off");
> +
>  #if defined(CONFIG_SYS_ALT_MEMTEST)
> -	printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
>  	debug("%s:%d: start 0x%p end 0x%p\n",
>  		__FUNCTION__, __LINE__, start, end);

OK, I'll do that next week.

Best regards,
Benoît
Albert ARIBAUD Aug. 14, 2012, 6:27 a.m. UTC | #2
Hi Mike,

On Sat, 11 Aug 2012 16:15:16 -0400, Mike Frysinger <vapier@gentoo.org>
wrote:
> On Saturday 11 August 2012 16:05:36 Benoît Thébaudeau wrote:
> > On 08/11/2012 21:47, Andrew Dyer wrote:
> > > I agree with Mike, use the current dcache settings. U-boot has
> > > always assumed the user knew what they were doing.
> > > If you want to print a small message with the dcache setting that
> > > makes sense to me, but no big warning.
> > 
> > Then, something like the following at runtime in the first lines
> > printed my mtest?
> > 
> > dcache state: on
> 
> i'd be fine with that.  something like below (if you want to test &
> post, that'd be good).
> -mike

I'd disagree with this solution; one can easily overlook casual test
messages like these. To me it is better that the person doing mtest not
trust the cache state at all and check / set it.

Amicalement,
diff mbox

Patch

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 18f0a3f..5628f6a 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -651,8 +651,10 @@  int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	else
 		iteration_limit = 0;
 
+	printf("Testing %08x ... %08x (dcache: %s):\n", (uint)start, (uint)end,
+		dcache_status() ? "on" : "off");
+
 #if defined(CONFIG_SYS_ALT_MEMTEST)
-	printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
 	debug("%s:%d: start 0x%p end 0x%p\n",
 		__FUNCTION__, __LINE__, start, end);