Patchwork [2/4] sparc/leon: Make mmu_inval_dma_area flush dcache for LEONs without snooping enabled.

login
register
mail settings
Submitter Kristoffer Glembo
Date Jan. 11, 2011, 10:49 a.m.
Message ID <1294742946-1040-3-git-send-email-kristoffer@gaisler.com>
Download mbox | patch
Permalink /patch/78319/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Kristoffer Glembo - Jan. 11, 2011, 10:49 a.m.
Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>
---
 arch/sparc/kernel/ioport.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index cea49c0..bfcbd1e 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -50,10 +50,15 @@ 
 #include <asm/io-unit.h>
 #include <asm/leon.h>
 
-#ifdef CONFIG_SPARC_LEON
-#define mmu_inval_dma_area(p, l) leon_flush_dcache_all()
-#else
+#ifndef CONFIG_SPARC_LEON
 #define mmu_inval_dma_area(p, l)	/* Anton pulled it out for 2.4.0-xx */
+#else
+static inline void mmu_inval_dma_area(unsigned long va, unsigned long len)
+{
+	if (!sparc_leon3_snooping_enabled()) {
+		leon_flush_dcache_all();
+	}
+}
 #endif
 
 static struct resource *_sparc_find_resource(struct resource *r,