All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: FIX for dcache_disable() for ARM926ej-s
Date: Tue, 08 Nov 2011 21:57:38 +0100	[thread overview]
Message-ID: <4EB997C2.2080809@aribaud.net> (raw)
In-Reply-To: <20111104094048.GA13470@altenpts-laptop>

Hi Bas,

Le 04/11/2011 10:40, Bas van den Berg a ?crit :
> the cache also needs to be invalidated, not just flushed, Since re-enabling it,
> can cause inconsistent data without invalidation.
>
> Signed-off-by: Bas van den Berg<b.van.den.berg.nl@gmail.com>
> ---
>   arch/arm/lib/cache.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
> index b545fb7..10eb8c9 100644
> --- a/arch/arm/lib/cache.c
> +++ b/arch/arm/lib/cache.c
> @@ -37,6 +37,8 @@ void  __flush_cache(unsigned long start, unsigned long size)
>   	asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
>   	/* disable write buffer as well (page 2-22) */
>   	asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
> +    /* Invalidate dcache as well */
> +    asm("mcr p15, 0, %0, c7, c6, 0" : : "r" (0));
>   #endif
>   	return;
>   }

Come to think of it... NAK, sorry. Flushing should do what it says on 
the tin, and invalidating is not what it says -- especially considering 
your intent is not about flushing but about disabling ('re-enabling...')

If you need the cache to be flushed then invalidated then disabled, then 
call all three functions where you need that, i.e. find the place where 
there is only a call to __flush_cache() and append a call to 
__invalidate_cache(), and if that happens a lot, then feel free to 
provide a new function that will sequence flush and invalidate.

Amicalement,
-- 
Albert.

      reply	other threads:[~2011-11-08 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04  9:40 [U-Boot] [PATCH] ARM: FIX for dcache_disable() for ARM926ej-s Bas van den Berg
2011-11-08 20:57 ` Albert ARIBAUD [this message]

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=4EB997C2.2080809@aribaud.net \
    --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 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.