kernel: update 3.18 to 3.18.14
[openwrt/svn-archive/archive.git] / target / linux / oxnas / patches-3.18 / 010-arm_introduce-dma-fiq-irq-broadcast.patch
1 --- a/arch/arm/include/asm/glue-cache.h
2 +++ b/arch/arm/include/asm/glue-cache.h
3 @@ -156,11 +156,19 @@ static 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)
9
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)
13 +#else
14 +#define __cpuc_flush_dcache_area __glue(fiq,_flush_kern_dcache_area)
15 +
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 */
20 #endif
21
22 #endif
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).
28
29 +config DMA_CACHE_FIQ_BROADCAST
30 + bool "Enable fiq broadcast DMA cache maintenance"
31 + depends on CPU_V6K && SMP
32 + select FIQ
33 + help
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.
39 +
40 config OUTER_CACHE
41 bool
42
43 --- a/arch/arm/mm/flush.c
44 +++ b/arch/arm/mm/flush.c
45 @@ -314,7 +314,11 @@ void flush_dcache_page(struct page *page
46
47 mapping = page_mapping(page);
48
49 +#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
50 if (!cache_ops_need_broadcast() &&
51 +#else
52 + if (
53 +#endif
54 mapping && !page_mapped(page))
55 clear_bit(PG_dcache_clean, &page->flags);
56 else {