]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
dma-direct: remove the cached_kernel_address hook
authorChristoph Hellwig <hch@lst.de>
Fri, 21 Feb 2020 20:24:02 +0000 (12:24 -0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 16 Mar 2020 09:48:02 +0000 (10:48 +0100)
dma-direct now finds the kernel address for coherent allocations based
on the dma address, so the cached_kernel_address hooks is unused and
can be removed entirely.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
arch/Kconfig
arch/microblaze/mm/consistent.c
arch/mips/mm/dma-noncoherent.c
arch/nios2/mm/dma-mapping.c
arch/xtensa/kernel/pci-dma.c
include/linux/dma-noncoherent.h

index 98de654b79b312eca4737efff9b6b1460cb94f37..7994b239f155af600a90b6698b4ea31d0848e1a8 100644 (file)
@@ -249,7 +249,7 @@ config ARCH_HAS_SET_DIRECT_MAP
 
 #
 # Select if arch has an uncached kernel segment and provides the
-# uncached_kernel_address / cached_kernel_address symbols to use it
+# uncached_kernel_address symbol to use it
 #
 config ARCH_HAS_UNCACHED_SEGMENT
        select ARCH_HAS_DMA_PREP_COHERENT
index 8c5f0c332d8b64ed4cf2008a292e05a39cfa0546..cede7c5e8135f4df85b336f32078e01432f2dccf 100644 (file)
@@ -49,11 +49,4 @@ void *uncached_kernel_address(void *ptr)
                pr_warn("ERROR: Your cache coherent area is CACHED!!!\n");
        return (void *)addr;
 }
-
-void *cached_kernel_address(void *ptr)
-{
-       unsigned long addr = (unsigned long)ptr;
-
-       return (void *)(addr & ~UNCACHED_SHADOW_MASK);
-}
 #endif /* CONFIG_MMU */
index dc42ffc838254351fcc925914902ebf4b47cef0e..77dce28ad0a07f6d246dab5bd8bf8d6d52fe2052 100644 (file)
@@ -54,11 +54,6 @@ void *uncached_kernel_address(void *addr)
        return (void *)(__pa(addr) + UNCAC_BASE);
 }
 
-void *cached_kernel_address(void *addr)
-{
-       return __va(addr) - UNCAC_BASE;
-}
-
 static inline void dma_sync_virt(void *addr, size_t size,
                enum dma_data_direction dir)
 {
index 0ed711e379020aa2adff898a50284734af5dcb8c..f30f2749257ce0a24b92fb077c245f4c4b763a89 100644 (file)
@@ -75,13 +75,3 @@ void *uncached_kernel_address(void *ptr)
 
        return (void *)ptr;
 }
-
-void *cached_kernel_address(void *ptr)
-{
-       unsigned long addr = (unsigned long)ptr;
-
-       addr &= ~CONFIG_NIOS2_IO_REGION_BASE;
-       addr |= CONFIG_NIOS2_KERNEL_REGION_BASE;
-
-       return (void *)ptr;
-}
index 72b6222daa0b3d3e4d1ea104d26588a0c5768b05..6a685545d5c9d89289be7e090e3e50cdaf19a91a 100644 (file)
@@ -88,18 +88,12 @@ void arch_dma_prep_coherent(struct page *page, size_t size)
 
 /*
  * Memory caching is platform-dependent in noMMU xtensa configurations.
- * The following two functions should be implemented in platform code
- * in order to enable coherent DMA memory operations when CONFIG_MMU is not
- * enabled.
+ * This function should be implemented in platform code in order to enable
+ * coherent DMA memory operations when CONFIG_MMU is not enabled.
  */
 #ifdef CONFIG_MMU
 void *uncached_kernel_address(void *p)
 {
        return p + XCHAL_KSEG_BYPASS_VADDR - XCHAL_KSEG_CACHED_VADDR;
 }
-
-void *cached_kernel_address(void *p)
-{
-       return p + XCHAL_KSEG_CACHED_VADDR - XCHAL_KSEG_BYPASS_VADDR;
-}
 #endif /* CONFIG_MMU */
index ca9b5770caee0380597a65007690e65d80c47bea..b6b72e19b0cd922054e24c1ee793deb8f969da9b 100644 (file)
@@ -109,6 +109,5 @@ static inline void arch_dma_prep_coherent(struct page *page, size_t size)
 #endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */
 
 void *uncached_kernel_address(void *addr);
-void *cached_kernel_address(void *addr);
 
 #endif /* _LINUX_DMA_NONCOHERENT_H */