010-arm_introduce-dma-fiq-irq-broadcast.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #define dmac_map_area __glue(_CACHE,_dma_map_area)
  10. #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
  11. #define dmac_flush_range __glue(_CACHE,_dma_flush_range)
  12. +#else
  13. +#define __cpuc_flush_dcache_area __glue(fiq,_flush_kern_dcache_area)
  14. +
  15. +#define dmac_map_area __glue(fiq,_dma_map_area)
  16. +#define dmac_unmap_area __glue(fiq,_dma_unmap_area)
  17. +#define dmac_flush_range __glue(fiq,_dma_flush_range)
  18. +#endif /* CONFIG_DMA_CACHE_FIQ_BROADCAST */
  19. #endif
  20. #endif
  21. --- a/arch/arm/mm/Kconfig
  22. +++ b/arch/arm/mm/Kconfig
  23. @@ -858,6 +858,17 @@ config DMA_CACHE_RWFO
  24. in hardware, other workarounds are needed (e.g. cache
  25. maintenance broadcasting in software via FIQ).
  26. +config DMA_CACHE_FIQ_BROADCAST
  27. + bool "Enable fiq broadcast DMA cache maintenance"
  28. + depends on CPU_V6K && SMP
  29. + select FIQ
  30. + help
  31. + The Snoop Control Unit on ARM11MPCore does not detect the
  32. + cache maintenance operations and the dma_{map,unmap}_area()
  33. + functions may leave stale cache entries on other CPUs. By
  34. + enabling this option, fiq broadcast in the ARMv6
  35. + DMA cache maintenance functions is performed.
  36. +
  37. config OUTER_CACHE
  38. bool
  39. --- a/arch/arm/mm/flush.c
  40. +++ b/arch/arm/mm/flush.c
  41. @@ -314,7 +314,11 @@ void flush_dcache_page(struct page *page
  42. mapping = page_mapping(page);
  43. +#ifndef CONFIG_DMA_CACHE_FIQ_BROADCAST
  44. if (!cache_ops_need_broadcast() &&
  45. +#else
  46. + if (
  47. +#endif
  48. mapping && !page_mapped(page))
  49. clear_bit(PG_dcache_clean, &page->flags);
  50. else {