public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARMv8: Bug fix of dcache_disable()
@ 2015-02-09  8:51 fenghua at phytium.com.cn
  2015-02-09 11:05 ` Mark Rutland
  0 siblings, 1 reply; 6+ messages in thread
From: fenghua at phytium.com.cn @ 2015-02-09  8:51 UTC (permalink / raw)
  To: u-boot

From: David Feng <fenghua@phytium.com.cn>

The cache disable operation shoud be performed after flush_dcache_all().
If cache disable operation is performed before
flush_dcache_all(), flush_dcache_all() store data directly to memory
and may be overrided by data copy in cache.

Signed-off-by: David Feng <fenghua@phytium.com.cn>
---
 arch/arm/cpu/armv8/cache_v8.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index 9dbcdf2..dc2fc8c 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -124,9 +124,10 @@ void dcache_disable(void)
 	if (!(sctlr & CR_C))
 		return;
 
+	flush_dcache_all();
+
 	set_sctlr(sctlr & ~(CR_C|CR_M));
 
-	flush_dcache_all();
 	__asm_invalidate_tlb_all();
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-03 11:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-09  8:51 [U-Boot] [PATCH] ARMv8: Bug fix of dcache_disable() fenghua at phytium.com.cn
2015-02-09 11:05 ` Mark Rutland
2015-02-11  3:26   ` FengHua
2015-02-11 15:51     ` Mark Rutland
2015-02-26 15:06       ` FengHua
2015-03-03 11:58         ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox