Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: DMA: Implement platform hook to perform post-DMA cache flushes.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+35 -1
+4
arch/mips/include/asm/mach-ath25/dma-coherence.h
··· 69 69 #endif 70 70 } 71 71 72 + static inline void plat_post_dma_flush(struct device *dev) 73 + { 74 + } 75 + 72 76 #endif /* __ASM_MACH_ATH25_DMA_COHERENCE_H */
+4
arch/mips/include/asm/mach-bmips/dma-coherence.h
··· 45 45 return 0; 46 46 } 47 47 48 + static inline void plat_post_dma_flush(struct device *dev) 49 + { 50 + } 51 + 48 52 #endif /* __ASM_MACH_BMIPS_DMA_COHERENCE_H */
+4
arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
··· 57 57 return 1; 58 58 } 59 59 60 + static inline void plat_post_dma_flush(struct device *dev) 61 + { 62 + } 63 + 60 64 dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr); 61 65 phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr); 62 66
+4
arch/mips/include/asm/mach-generic/dma-coherence.h
··· 52 52 return coherentio; 53 53 } 54 54 55 + static inline void plat_post_dma_flush(struct device *dev) 56 + { 57 + } 58 + 55 59 #ifdef CONFIG_SWIOTLB 56 60 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) 57 61 {
+4
arch/mips/include/asm/mach-ip27/dma-coherence.h
··· 58 58 return 1; 59 59 } 60 60 61 + static inline void plat_post_dma_flush(struct device *dev) 62 + { 63 + } 64 + 61 65 static inline int plat_device_is_coherent(struct device *dev) 62 66 { 63 67 return 1; /* IP27 non-cohernet mode is unsupported */
+4
arch/mips/include/asm/mach-ip32/dma-coherence.h
··· 80 80 return 1; 81 81 } 82 82 83 + static inline void plat_post_dma_flush(struct device *dev) 84 + { 85 + } 86 + 83 87 static inline int plat_device_is_coherent(struct device *dev) 84 88 { 85 89 return 0; /* IP32 is non-cohernet */
+4
arch/mips/include/asm/mach-jazz/dma-coherence.h
··· 48 48 return 1; 49 49 } 50 50 51 + static inline void plat_post_dma_flush(struct device *dev) 52 + { 53 + } 54 + 51 55 static inline int plat_device_is_coherent(struct device *dev) 52 56 { 53 57 return 0;
+4
arch/mips/include/asm/mach-loongson/dma-coherence.h
··· 78 78 #endif /* CONFIG_DMA_NONCOHERENT */ 79 79 } 80 80 81 + static inline void plat_post_dma_flush(struct device *dev) 82 + { 83 + } 84 + 81 85 #endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */
+3 -1
arch/mips/mm/dma-default.c
··· 258 258 if (cpu_needs_post_dma_flush(dev)) 259 259 __dma_sync(dma_addr_to_page(dev, dma_addr), 260 260 dma_addr & ~PAGE_MASK, size, direction); 261 - 261 + plat_post_dma_flush(dev); 262 262 plat_unmap_dma_mem(dev, dma_addr, size, direction); 263 263 } 264 264 ··· 312 312 if (cpu_needs_post_dma_flush(dev)) 313 313 __dma_sync(dma_addr_to_page(dev, dma_handle), 314 314 dma_handle & ~PAGE_MASK, size, direction); 315 + plat_post_dma_flush(dev); 315 316 } 316 317 317 318 static void mips_dma_sync_single_for_device(struct device *dev, ··· 332 331 for (i = 0; i < nelems; i++, sg++) 333 332 __dma_sync(sg_page(sg), sg->offset, sg->length, 334 333 direction); 334 + plat_post_dma_flush(dev); 335 335 } 336 336 337 337 static void mips_dma_sync_sg_for_device(struct device *dev,