public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] arm: arm926ejs: flush cache before disable it
Date: Fri, 5 Jul 2013 23:02:00 +0200	[thread overview]
Message-ID: <20130705230200.5c64c39c@lilith> (raw)
In-Reply-To: <1372768555-12477-1-git-send-email-voice.shen@gmail.com>

Hi Bo,

On Tue,  2 Jul 2013 12:35:54 +0000, Bo Shen <voice.shen@gmail.com>
wrote:

> flush cache before disable it
> 
> Signed-off-by: Bo Shen <voice.shen@gmail.com>
> ---
>  arch/arm/cpu/arm926ejs/cpu.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/cpu.c b/arch/arm/cpu/arm926ejs/cpu.c
> index 626384c..10aa165 100644
> --- a/arch/arm/cpu/arm926ejs/cpu.c
> +++ b/arch/arm/cpu/arm926ejs/cpu.c
> @@ -46,15 +46,14 @@ int cleanup_before_linux (void)
>  
>  	disable_interrupts ();
>  
> +	/* flush I/D-cache */
> +	cache_flush();
>  
>  	/* turn off I/D-cache */
>  	icache_disable();
>  	dcache_disable();
>  	l2_cache_disable();
>  
> -	/* flush I/D-cache */
> -	cache_flush();
> -
>  	return 0;
>  }

What is this change supposed to fix? There is no need to flush before
disabling, and actually, flushing before disabling runs the risk that
between the two, some cache lines be dirtied again so that cache and
memory won't be coherent any more.

Amicalement,
-- 
Albert.

  reply	other threads:[~2013-07-05 21:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 12:35 [U-Boot] [RFC PATCH] arm: arm926ejs: flush cache before disable it Bo Shen
2013-07-05 21:02 ` Albert ARIBAUD [this message]
2013-07-07 23:33   ` Bo Shen
2013-07-08 10:22     ` Albert ARIBAUD
2013-07-08 12:08       ` Sughosh Ganu
2013-07-08 12:32         ` Albert ARIBAUD
2013-07-08 14:07           ` Sughosh Ganu
2013-07-08 19:55             ` Albert ARIBAUD
2013-07-09  3:59               ` Sughosh Ganu
2013-07-09  6:11               ` Sughosh Ganu
2013-07-09  8:28                 ` Albert ARIBAUD
2013-07-10 10:05                   ` Sughosh Ganu
2013-07-10 12:30                     ` Albert ARIBAUD
2013-07-10 17:34                       ` Sughosh Ganu
2013-07-12  7:35                         ` Albert ARIBAUD
2013-07-08 12:19       ` Sughosh Ganu

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=20130705230200.5c64c39c@lilith \
    --to=albert.u.boot@aribaud.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox