All of lore.kernel.org
 help / color / mirror / Atom feed
From: john.stultz@linaro.org (John Stultz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] Optionally flush entire dcache from v6_dma_flush_range
Date: Mon, 13 Dec 2010 20:57:37 -0800	[thread overview]
Message-ID: <1292302659-1863-3-git-send-email-john.stultz@linaro.org> (raw)
In-Reply-To: <1292302659-1863-1-git-send-email-john.stultz@linaro.org>

From: Arve Hj?nnev?g <arve@android.com>

If CACHE_FLUSH_RANGE_LIMIT is defined, then the entire dcache will
be flushed if the requested range is larger than this limit.

CC: Nicolas Pitre <nicolas.pitre@linaro.org>
CC: Russell King <linux@arm.linux.org.uk>
Change-Id: I29277d645a9d6716b1952cf3b870c78496261dd0
Signed-off-by: Arve Hj?nnev?g <arve@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 arch/arm/mm/cache-v6.S |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
index 99fa688..92c66b4 100644
--- a/arch/arm/mm/cache-v6.S
+++ b/arch/arm/mm/cache-v6.S
@@ -263,6 +263,11 @@ v6_dma_clean_range:
  *	- end     - virtual end address of region
  */
 ENTRY(v6_dma_flush_range)
+#ifdef CONFIG_CACHE_FLUSH_RANGE_LIMIT
+	sub	r2, r1, r0
+	cmp	r2, #CONFIG_CACHE_FLUSH_RANGE_LIMIT
+	bhi	v6_dma_flush_dcache_all
+#endif
 	bic	r0, r0, #D_CACHE_LINE_SIZE - 1
 1:
 #ifdef CONFIG_DMA_CACHE_RWFO
@@ -281,6 +286,18 @@ ENTRY(v6_dma_flush_range)
 	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
 	mov	pc, lr
 
+#ifdef CONFIG_CACHE_FLUSH_RANGE_LIMIT
+v6_dma_flush_dcache_all:
+	mov	r0, #0
+#ifdef HARVARD_CACHE
+	mcr	p15, 0, r0, c7, c14, 0		@ D cache clean+invalidate
+#else
+	mcr	p15, 0, r0, c7, c15, 0		@ Cache clean+invalidate
+#endif
+	mcr	p15, 0, r0, c7, c10, 4		@ drain write buffer
+	mov	pc, lr
+#endif
+
 /*
  *	dma_map_area(start, size, dir)
  *	- start	- kernel virtual start address
-- 
1.7.3.2.146.gca209

  parent reply	other threads:[~2010-12-14  4:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14  4:57 [PATCH 0/4][RFC] Trivial ARM related Android patches John Stultz
2010-12-14  4:57 ` [PATCH 1/4] avoid mis-detecting some V7 cores in the decompressor John Stultz
2010-12-14  4:57 ` John Stultz [this message]
2010-12-14  9:30   ` [PATCH 2/4] Optionally flush entire dcache from v6_dma_flush_range Russell King - ARM Linux
2010-12-14 10:58   ` Catalin Marinas
2010-12-14  4:57 ` [PATCH 3/4] process: Add display of memory around registers when displaying regs John Stultz
2010-12-14  9:34   ` Russell King - ARM Linux
2010-12-14  4:57 ` [PATCH 4/4] Do not call flush_cache_user_range with mmap_sem held John Stultz
2010-12-14  9:30   ` Russell King - ARM Linux
2010-12-14 17:51     ` Catalin Marinas
2010-12-14 19:05       ` Russell King - ARM Linux
2010-12-14 21:08         ` Catalin Marinas
2011-04-04 13:27           ` Catalin Marinas
2011-04-04 13:37             ` Russell King - ARM Linux
2011-04-04 13:43               ` Catalin Marinas
2011-08-26  7:32                 ` Jiejing.Zhang 
2011-09-05 11:21                   ` Catalin Marinas
2010-12-14 18:18   ` Catalin Marinas

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=1292302659-1863-3-git-send-email-john.stultz@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.