Skip to content

Commit 4f8232b

Browse files
author
Christoph Hellwig
committed
dma-direct: remove the cached_kernel_address hook
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 <[email protected]> Reviewed-by: Robin Murphy <[email protected]>
1 parent 286c21d commit 4f8232b

File tree

6 files changed

+3
-32
lines changed

6 files changed

+3
-32
lines changed

arch/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ config ARCH_HAS_SET_DIRECT_MAP
249249

250250
#
251251
# Select if arch has an uncached kernel segment and provides the
252-
# uncached_kernel_address / cached_kernel_address symbols to use it
252+
# uncached_kernel_address symbol to use it
253253
#
254254
config ARCH_HAS_UNCACHED_SEGMENT
255255
select ARCH_HAS_DMA_PREP_COHERENT

arch/microblaze/mm/consistent.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,4 @@ void *uncached_kernel_address(void *ptr)
4949
pr_warn("ERROR: Your cache coherent area is CACHED!!!\n");
5050
return (void *)addr;
5151
}
52-
53-
void *cached_kernel_address(void *ptr)
54-
{
55-
unsigned long addr = (unsigned long)ptr;
56-
57-
return (void *)(addr & ~UNCACHED_SHADOW_MASK);
58-
}
5952
#endif /* CONFIG_MMU */

arch/mips/mm/dma-noncoherent.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ void *uncached_kernel_address(void *addr)
5454
return (void *)(__pa(addr) + UNCAC_BASE);
5555
}
5656

57-
void *cached_kernel_address(void *addr)
58-
{
59-
return __va(addr) - UNCAC_BASE;
60-
}
61-
6257
static inline void dma_sync_virt(void *addr, size_t size,
6358
enum dma_data_direction dir)
6459
{

arch/nios2/mm/dma-mapping.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,3 @@ void *uncached_kernel_address(void *ptr)
7575

7676
return (void *)ptr;
7777
}
78-
79-
void *cached_kernel_address(void *ptr)
80-
{
81-
unsigned long addr = (unsigned long)ptr;
82-
83-
addr &= ~CONFIG_NIOS2_IO_REGION_BASE;
84-
addr |= CONFIG_NIOS2_KERNEL_REGION_BASE;
85-
86-
return (void *)ptr;
87-
}

arch/xtensa/kernel/pci-dma.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,12 @@ void arch_dma_prep_coherent(struct page *page, size_t size)
8888

8989
/*
9090
* Memory caching is platform-dependent in noMMU xtensa configurations.
91-
* The following two functions should be implemented in platform code
92-
* in order to enable coherent DMA memory operations when CONFIG_MMU is not
93-
* enabled.
91+
* This function should be implemented in platform code in order to enable
92+
* coherent DMA memory operations when CONFIG_MMU is not enabled.
9493
*/
9594
#ifdef CONFIG_MMU
9695
void *uncached_kernel_address(void *p)
9796
{
9897
return p + XCHAL_KSEG_BYPASS_VADDR - XCHAL_KSEG_CACHED_VADDR;
9998
}
100-
101-
void *cached_kernel_address(void *p)
102-
{
103-
return p + XCHAL_KSEG_CACHED_VADDR - XCHAL_KSEG_BYPASS_VADDR;
104-
}
10599
#endif /* CONFIG_MMU */

include/linux/dma-noncoherent.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,5 @@ static inline void arch_dma_prep_coherent(struct page *page, size_t size)
109109
#endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */
110110

111111
void *uncached_kernel_address(void *addr);
112-
void *cached_kernel_address(void *addr);
113112

114113
#endif /* _LINUX_DMA_NONCOHERENT_H */

0 commit comments

Comments
 (0)