From: Mark Rutland <mark.rutland@arm.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush
Date: Wed, 15 Apr 2015 14:10:58 +0100 [thread overview]
Message-ID: <20150415131058.GG2866@leverpostej> (raw)
In-Reply-To: <b57c5d00d9ca21c0d00a269010aea7860832e70e.1429097578.git.michal.simek@xilinx.com>
On Wed, Apr 15, 2015 at 12:33:00PM +0100, Michal Simek wrote:
> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
>
> Always disable dcache after the flush operation
> The following sequence is advisable while disabling d-cache:
> 1. disable_dcache() - flushes and disables d-cache
> 2. invalidate_dcache_all() - invalid any entry that came to the cache
> in the short period after the cache was flushed but before the
> cache got disabled
For reasons I have described previously (see [1,2,3]), this is unsafe.
The first cache flush may achieve nothing.
If you need data out at the PoC before disabling the cache, then you
should first use maintenance by VA to push that data out.
Thanks,
Mark.
[1] http://lists.denx.de/pipermail/u-boot/2015-February/204403.html
[2] http://lists.denx.de/pipermail/u-boot/2015-February/204407.html
[3] http://lists.denx.de/pipermail/u-boot/2015-February/204702.html
>
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> arch/arm/cpu/armv8/cache_v8.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
> index c5ec5297cd39..2a0492fbef52 100644
> --- a/arch/arm/cpu/armv8/cache_v8.c
> +++ b/arch/arm/cpu/armv8/cache_v8.c
> @@ -128,10 +128,10 @@ void dcache_disable(void)
> if (!(sctlr & CR_C))
> return;
>
> - set_sctlr(sctlr & ~(CR_C|CR_M));
> -
> flush_dcache_all();
> __asm_invalidate_tlb_all();
> +
> + set_sctlr(sctlr & ~(CR_C|CR_M));
> }
>
> int dcache_status(void)
> --
> 2.3.5
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
next prev parent reply other threads:[~2015-04-15 13:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 11:33 [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush Michal Simek
2015-04-15 11:33 ` [U-Boot] [PATCH 2/2] armv8: caches: Added routine to set non cacheable region zzz Michal Simek
2015-04-15 13:10 ` Mark Rutland [this message]
2015-04-16 5:17 ` [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush Siva Durga Prasad Paladugu
2015-04-16 9:58 ` Mark Rutland
2015-04-17 4:35 ` Siva Durga Prasad Paladugu
2015-04-17 10:06 ` Mark Rutland
2015-04-17 10:43 ` Siva Durga Prasad Paladugu
2015-04-20 10:18 ` Mark Rutland
2015-04-20 10:32 ` Siva Durga Prasad Paladugu
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=20150415131058.GG2866@leverpostej \
--to=mark.rutland@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox