public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: cache: exit maintenance functions when cache disabled
@ 2017-03-10 11:26 Gary Bisson
  2017-03-10 11:49 ` Siarhei Siamashka
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Bisson @ 2017-03-10 11:26 UTC (permalink / raw)
  To: u-boot

No need to check the region range and send commands when the cache
isn't even enabled.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
Hi all,

This is a follow-up to this thread:
https://lists.denx.de/pipermail/u-boot/2017-March/283423.html

Although what started the conversation was the sparse-image flashing
procedure, it appears cache maintenance functions don't check on cache
status.

Regards,
Gary
---
 arch/arm/cpu/armv7/cache_v7.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index c4bbcc3cc3..992cdeaa6e 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -117,6 +117,9 @@ void flush_dcache_all(void)
  */
 void invalidate_dcache_range(unsigned long start, unsigned long stop)
 {
+	if (!dcache_status())
+		return;
+
 	check_cache_range(start, stop);
 
 	v7_dcache_maint_range(start, stop, ARMV7_DCACHE_INVAL_RANGE);
@@ -131,6 +134,9 @@ void invalidate_dcache_range(unsigned long start, unsigned long stop)
  */
 void flush_dcache_range(unsigned long start, unsigned long stop)
 {
+	if (!dcache_status())
+		return;
+
 	check_cache_range(start, stop);
 
 	v7_dcache_maint_range(start, stop, ARMV7_DCACHE_CLEAN_INVAL_RANGE);
-- 
2.11.0

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

end of thread, other threads:[~2017-03-10 11:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10 11:26 [U-Boot] [PATCH] arm: cache: exit maintenance functions when cache disabled Gary Bisson
2017-03-10 11:49 ` Siarhei Siamashka

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