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 1/5] ARM: cache: Move the cp15 CR register read before flushing the cache.
Date: Sat, 7 Jul 2012 14:00:10 +0200	[thread overview]
Message-ID: <20120707140010.1c73d87f@lilith> (raw)
In-Reply-To: <1337248374-23252-1-git-send-email-r.sricharan@ti.com>

Hi R Sricharan,

On Thu, 17 May 2012 15:22:54 +0530, R Sricharan <r.sricharan@ti.com>
wrote:

> The following is the cleanup sequence in arch/arm/cpu/armv7/cpu.c
> 
> int cleanup_before_linux(void)
> {
>  ...
>  ...
>  dcache_disable();
>  v7_outer_cache_disable();
>  invalidate_dcache_all();
> }
> 
>  1) invalidate_dcache_all call expects that all the caches has been
>  flushed, invalidated and there are no dirty entries prior to its
>  execution.  In the above sequence dcache_disable() flushes,
> invalidates the caches and turns off the  mmu. But after it cleanups
> the cache and before the mmu is disabled  there is a cp_delay()
> function which has STR instruction. On certain cores like the
> cortex-a15, cache hit and a write can happen to a cache line even
> when the dcache is disabled. So the above mentioned STR instruction
> creates a dirty entry after cleaning. The mmu gets disabled after
> this.
> 
>  2) invalidate_dcache_all invalidates the cache lines. Again on
>  cores like cortex-a15, invalidate instruction flushes the dirty
>  line as well. So some times the dirty line from sequence 1
>  can corrupt the memory resulting in a crash.
> 
>  Fixing this by moving the get_cr() and cp_delay() calls before
>  cleaning up the cache, thus avoiding the dirty entry.
> 
> Signed-off-by: R Sricharan <r.sricharan@ti.com>
> ---

Applied to u-boot-arm/master, thanks.

Amicalement,
-- 
Albert.

      parent reply	other threads:[~2012-07-07 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17  9:52 [U-Boot] [PATCH 1/5] ARM: cache: Move the cp15 CR register read before flushing the cache R Sricharan
2012-05-29 14:54 ` R, Sricharan
2012-06-05  8:58   ` Sricharan R
2012-06-05 20:25     ` Marek Vasut
2012-06-07  5:05       ` R, Sricharan
2012-07-07 12:00 ` 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=20120707140010.1c73d87f@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 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.