summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-19 16:27:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-19 16:27:23 -0400
commit671df189537883f36cf9c7d4f9495bfac0f86627 (patch)
tree22e5f598ed1f5d9b2218d85d4426140f804d61e6 /arch/mips
parentc9fe5630dae1df2328d82042602e2c4d1add8d57 (diff)
parentc7d9eccb3c1e802c5cbb2a764eb0eb9807d9f12e (diff)
Merge tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping updates from Christoph Hellwig: - add dma-mapping and block layer helpers to take care of IOMMU merging for mmc plus subsequent fixups (Yoshihiro Shimoda) - rework handling of the pgprot bits for remapping (me) - take care of the dma direct infrastructure for swiotlb-xen (me) - improve the dma noncoherent remapping infrastructure (me) - better defaults for ->mmap, ->get_sgtable and ->get_required_mask (me) - cleanup mmaping of coherent DMA allocations (me) - various misc cleanups (Andy Shevchenko, me) * tag 'dma-mapping-5.4' of git://git.infradead.org/users/hch/dma-mapping: (41 commits) mmc: renesas_sdhi_internal_dmac: Add MMC_CAP2_MERGE_CAPABLE mmc: queue: Fix bigger segments usage arm64: use asm-generic/dma-mapping.h swiotlb-xen: merge xen_unmap_single into xen_swiotlb_unmap_page swiotlb-xen: simplify cache maintainance swiotlb-xen: use the same foreign page check everywhere swiotlb-xen: remove xen_swiotlb_dma_mmap and xen_swiotlb_dma_get_sgtable xen: remove the exports for xen_{create,destroy}_contiguous_region xen/arm: remove xen_dma_ops xen/arm: simplify dma_cache_maint xen/arm: use dev_is_dma_coherent xen/arm: consolidate page-coherent.h xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance arm: remove wrappers for the generic dma remap helpers dma-mapping: introduce a dma_common_find_pages helper dma-mapping: always use VM_DMA_COHERENT for generic DMA remap vmalloc: lift the arm flag for coherent mappings to common code dma-mapping: provide a better default ->get_required_mask dma-mapping: remove the dma_declare_coherent_memory export remoteproc: don't allow modular build ...
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/Kconfig9
-rw-r--r--arch/mips/jazz/jazzdma.c2
-rw-r--r--arch/mips/mm/dma-noncoherent.c8
3 files changed, 10 insertions, 9 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d50fafd7bf3a..aff1cadeea43 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1119,7 +1119,14 @@ config DMA_PERDEV_COHERENT
1119 1119
1120config DMA_NONCOHERENT 1120config DMA_NONCOHERENT
1121 bool 1121 bool
1122 select ARCH_HAS_DMA_MMAP_PGPROT 1122 #
1123 # MIPS allows mixing "slightly different" Cacheability and Coherency
1124 # Attribute bits. It is believed that the uncached access through
1125 # KSEG1 and the implementation specific "uncached accelerated" used
1126 # by pgprot_writcombine can be mixed, and the latter sometimes provides
1127 # significant advantages.
1128 #
1129 select ARCH_HAS_DMA_WRITE_COMBINE
1123 select ARCH_HAS_SYNC_DMA_FOR_DEVICE 1130 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
1124 select ARCH_HAS_UNCACHED_SEGMENT 1131 select ARCH_HAS_UNCACHED_SEGMENT
1125 select NEED_DMA_MAP_STATE 1132 select NEED_DMA_MAP_STATE
diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c
index 1804dc9d8136..a01e14955187 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -682,5 +682,7 @@ const struct dma_map_ops jazz_dma_ops = {
682 .sync_sg_for_device = jazz_dma_sync_sg_for_device, 682 .sync_sg_for_device = jazz_dma_sync_sg_for_device,
683 .dma_supported = dma_direct_supported, 683 .dma_supported = dma_direct_supported,
684 .cache_sync = arch_dma_cache_sync, 684 .cache_sync = arch_dma_cache_sync,
685 .mmap = dma_common_mmap,
686 .get_sgtable = dma_common_get_sgtable,
685}; 687};
686EXPORT_SYMBOL(jazz_dma_ops); 688EXPORT_SYMBOL(jazz_dma_ops);
diff --git a/arch/mips/mm/dma-noncoherent.c b/arch/mips/mm/dma-noncoherent.c
index ed56c6fa7be2..1d4d57dd9acf 100644
--- a/arch/mips/mm/dma-noncoherent.c
+++ b/arch/mips/mm/dma-noncoherent.c
@@ -65,14 +65,6 @@ long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
65 return page_to_pfn(virt_to_page(cached_kernel_address(cpu_addr))); 65 return page_to_pfn(virt_to_page(cached_kernel_address(cpu_addr)));
66} 66}
67 67
68pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
69 unsigned long attrs)
70{
71 if (attrs & DMA_ATTR_WRITE_COMBINE)
72 return pgprot_writecombine(prot);
73 return pgprot_noncached(prot);
74}
75
76static inline void dma_sync_virt(void *addr, size_t size, 68static inline void dma_sync_virt(void *addr, size_t size,
77 enum dma_data_direction dir) 69 enum dma_data_direction dir)
78{ 70{