1 --- a/arch/arm/include/asm/glue-cache.h
2 +++ b/arch/arm/include/asm/glue-cache.h
3 @@ -156,11 +156,19 @@ extern inline void nop_dma_unmap_area(co
4 #define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
5 #define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
6 #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
7 +#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
8 #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
10 #define dmac_map_area __glue(_CACHE,_dma_map_area)
11 #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
12 #define dmac_flush_range __glue(_CACHE,_dma_flush_range)
14 +#define __cpuc_flush_dcache_area __glue(fiq,_flush_kern_dcache_area)
16 +#define dmac_map_area __glue(fiq,_dma_map_area)
17 +#define dmac_unmap_area __glue(fiq,_dma_unmap_area)
18 +#define dmac_flush_range __glue(fiq,_dma_flush_range)
19 +#endif /* CONFIG_DMA_CACHE_FIQ_BROADCAST */
23 --- a/arch/arm/mm/Kconfig
24 +++ b/arch/arm/mm/Kconfig
25 @@ -844,6 +844,17 @@ config DMA_CACHE_RWFO
26 in hardware, other workarounds are needed (e.g. cache
27 maintenance broadcasting in software via FIQ).
29 +config DMA_CACHE_FIQ_BROADCAST
30 + bool "Enable fiq broadcast DMA cache maintenance"
31 + depends on CPU_V6K && SMP
34 + The Snoop Control Unit on ARM11MPCore does not detect the
35 + cache maintenance operations and the dma_{map,unmap}_area()
36 + functions may leave stale cache entries on other CPUs. By
37 + enabling this option, fiq broadcast in the ARMv6
38 + DMA cache maintenance functions is performed.
43 --- a/arch/arm/mm/flush.c
44 +++ b/arch/arm/mm/flush.c
45 @@ -281,6 +281,7 @@ void __sync_icache_dcache(pte_t pteval)
46 void flush_dcache_page(struct page *page)
48 struct address_space *mapping;
49 + bool skip_broadcast = true;
52 * The zero page is never written to, so never has any dirty
53 @@ -291,7 +292,10 @@ void flush_dcache_page(struct page *page
55 mapping = page_mapping(page);
57 - if (!cache_ops_need_broadcast() &&
58 +#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
59 + skip_broadcast = !cache_ops_need_broadcast();
61 + if (skip_broadcast &&
62 mapping && !page_mapped(page))
63 clear_bit(PG_dcache_clean, &page->flags);