[patch 056/108] ARM: 5545/2: add flush_kernel_dcache_page() for ARM

From: Greg KH
Date: Tue Jun 30 2009 - 21:02:29 EST


2.6.30-stable review patch. If anyone has any objections, please let us know.

------------------

From: Nicolas Pitre <nico@xxxxxxx>

commit 73be1591579084a8103a7005dd3172f3e9dd7362 upstream.

Without this, the default implementation is a no op which is completely
wrong with a VIVT cache, and usage of sg_copy_buffer() produces
unpredictable results.

Tested-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

Signed-off-by: Nicolas Pitre <nico@xxxxxxxxxxx>
Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
arch/arm/include/asm/cacheflush.h | 8 ++++++++
1 file changed, 8 insertions(+)

--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -429,6 +429,14 @@ static inline void flush_anon_page(struc
__flush_anon_page(vma, page, vmaddr);
}

+#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
+static inline void flush_kernel_dcache_page(struct page *page)
+{
+ /* highmem pages are always flushed upon kunmap already */
+ if ((cache_is_vivt() || cache_is_vipt_aliasing()) && !PageHighMem(page))
+ __cpuc_flush_dcache_page(page_address(page));
+}
+
#define flush_dcache_mmap_lock(mapping) \
spin_lock_irq(&(mapping)->tree_lock)
#define flush_dcache_mmap_unlock(mapping) \


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/