diff mbox

[4/6,V3] sparc/leon: Make mmu_inval_dma_area flush dcache for LEONs without snooping enabled.

Message ID 1295359829-27308-5-git-send-email-kristoffer@gaisler.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Kristoffer Glembo Jan. 18, 2011, 2:10 p.m. UTC
Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>
---
 arch/sparc/kernel/ioport.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

Comments

Sam Ravnborg Jan. 18, 2011, 7:40 p.m. UTC | #1
On Tue, Jan 18, 2011 at 03:10:27PM +0100, Kristoffer Glembo wrote:
> Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>

Looks OK to me.
But I do not know enough about the background to add
my "Acked-by:" as this imply some knowledge about the code touched.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 22, 2011, 12:51 a.m. UTC | #2
From: Sam Ravnborg <sam@ravnborg.org>
Date: Tue, 18 Jan 2011 20:40:53 +0100

> On Tue, Jan 18, 2011 at 03:10:27PM +0100, Kristoffer Glembo wrote:
>> Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>
> 
> Looks OK to me.
> But I do not know enough about the background to add
> my "Acked-by:" as this imply some knowledge about the code touched.

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index b817481..815003b 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -50,10 +50,14 @@ 
 #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,