dma-mapping: remove CONFIG_ARCH_NO_COHERENT_DMA_MMAP
authorChristoph Hellwig <hch@lst.de>
Tue, 6 Aug 2019 12:06:40 +0000 (15:06 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 4 Sep 2019 09:13:18 +0000 (11:13 +0200)
CONFIG_ARCH_NO_COHERENT_DMA_MMAP is now functionally identical to
!CONFIG_MMU, so remove the separate symbol.  The only difference is that
arm did not set it for !CONFIG_MMU, but arm uses a separate dma mapping
implementation including its own mmap method, which is handled by moving
the CONFIG_MMU check in dma_can_mmap so that is only applies to the
dma-direct case, just as the other ifdefs for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> # m68k
arch/Kconfig
arch/c6x/Kconfig
arch/m68k/Kconfig
arch/microblaze/Kconfig
arch/sh/Kconfig
arch/xtensa/Kconfig
kernel/dma/mapping.c

index a7b57dd42c26698b319430ac65cd81610ba08b71..ec2834206d08bcf2aea8c758ab4cda19cae91151 100644 (file)
@@ -790,9 +790,6 @@ config COMPAT_32BIT_TIME
          This is relevant on all 32-bit architectures, and 64-bit architectures
          as part of compat syscall handling.
 
-config ARCH_NO_COHERENT_DMA_MMAP
-       bool
-
 config ARCH_NO_PREEMPT
        bool
 
index b4fb61c83494a36b228e0d6e5e7420626240506b..e65e8d82442a20164f298cb5fd1c183f441cebfe 100644 (file)
@@ -20,7 +20,6 @@ config C6X
        select OF_EARLY_FLATTREE
        select GENERIC_CLOCKEVENTS
        select MODULES_USE_ELF_RELA
-       select ARCH_NO_COHERENT_DMA_MMAP
        select MMU_GATHER_NO_RANGE if MMU
 
 config MMU
index a9e564306d3eed81813164a3dff34f01ab5989fc..935599893d3ed16395ba5a2736e25ed034601653 100644 (file)
@@ -7,7 +7,6 @@ config M68K
        select ARCH_HAS_DMA_PREP_COHERENT if HAS_DMA && MMU && !COLDFIRE
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA
        select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
-       select ARCH_NO_COHERENT_DMA_MMAP if !MMU
        select ARCH_NO_PREEMPT if !COLDFIRE
        select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
        select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE
index d411de05b6282ddddfc7b31d4eb0739fe947e0a4..632c9477a0f6693668fbf44e87d0922095ad92b9 100644 (file)
@@ -9,7 +9,6 @@ config MICROBLAZE
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
        select ARCH_MIGHT_HAVE_PC_PARPORT
-       select ARCH_NO_COHERENT_DMA_MMAP if !MMU
        select ARCH_WANT_IPC_PARSE_VERSION
        select BUILDTIME_EXTABLE_SORT
        select TIMER_OF
index 6b1b5941b6188777d657b82f848cede9bc3f73bf..f356ee674d89b7148f68a9eecc14c2f805fe00d9 100644 (file)
@@ -5,7 +5,6 @@ config SUPERH
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_MIGHT_HAVE_PC_PARPORT
-       select ARCH_NO_COHERENT_DMA_MMAP if !MMU
        select HAVE_PATA_PLATFORM
        select CLKDEV_LOOKUP
        select DMA_DECLARE_COHERENT
index ebc135bda92119f38abfc5cb2eb8c2d91f760d41..70653aed300527b466325733d019c9b825192511 100644 (file)
@@ -5,7 +5,6 @@ config XTENSA
        select ARCH_HAS_BINFMT_FLAT if !MMU
        select ARCH_HAS_SYNC_DMA_FOR_CPU
        select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-       select ARCH_NO_COHERENT_DMA_MMAP if !MMU
        select ARCH_USE_QUEUED_RWLOCKS
        select ARCH_USE_QUEUED_SPINLOCKS
        select ARCH_WANT_FRAME_POINTERS
index 18ba1ac93fc180713fd59ce8939a80ef574741e7..285de5fbc8e91d0ed1ab2a75f7ef10bfc15e0300 100644 (file)
@@ -188,7 +188,7 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
                void *cpu_addr, dma_addr_t dma_addr, size_t size,
                unsigned long attrs)
 {
-#ifndef CONFIG_ARCH_NO_COHERENT_DMA_MMAP
+#ifdef CONFIG_MMU
        unsigned long user_count = vma_pages(vma);
        unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
        unsigned long off = vma->vm_pgoff;
@@ -219,7 +219,7 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
                        user_count << PAGE_SHIFT, vma->vm_page_prot);
 #else
        return -ENXIO;
-#endif /* !CONFIG_ARCH_NO_COHERENT_DMA_MMAP */
+#endif /* CONFIG_MMU */
 }
 
 /**
@@ -233,12 +233,10 @@ bool dma_can_mmap(struct device *dev)
 {
        const struct dma_map_ops *ops = get_dma_ops(dev);
 
-       if (IS_ENABLED(CONFIG_ARCH_NO_COHERENT_DMA_MMAP))
-               return false;
-
        if (dma_is_direct(ops)) {
-               return dev_is_dma_coherent(dev) ||
-                       IS_ENABLED(CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN);
+               return IS_ENABLED(CONFIG_MMU) &&
+                      (dev_is_dma_coherent(dev) ||
+                       IS_ENABLED(CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN));
        }
 
        return ops->mmap != NULL;