diff options
author | Christoph Hellwig <hch@lst.de> | 2023-10-05 09:05:36 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2023-10-22 16:38:54 +0200 |
commit | 2c8ed1b960fb97c82ede5afc974329bfdb457f5f (patch) | |
tree | e6ec8ae5530fa02461f8c2ba7ef2b0551d375576 /kernel/dma/Kconfig | |
parent | da323d4640704001f2287f729124e1cd9d5684d0 (diff) | |
download | linux-stable-2c8ed1b960fb97c82ede5afc974329bfdb457f5f.tar.gz linux-stable-2c8ed1b960fb97c82ede5afc974329bfdb457f5f.tar.bz2 linux-stable-2c8ed1b960fb97c82ede5afc974329bfdb457f5f.zip |
dma-direct: add a CONFIG_ARCH_HAS_DMA_ALLOC symbol
Instead of using arch_dma_alloc if none of the generic coherent
allocators are used, require the architectures to explicitly opt into
providing it. This will used to deal with the case of m68knommu and
coldfire where we can't do any coherent allocations whatsoever, and
also makes it clear that arch_dma_alloc is a last resort.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
Diffstat (limited to 'kernel/dma/Kconfig')
-rw-r--r-- | kernel/dma/Kconfig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig index 4524db877eba..d62f5957f36b 100644 --- a/kernel/dma/Kconfig +++ b/kernel/dma/Kconfig @@ -144,6 +144,15 @@ config DMA_DIRECT_REMAP select DMA_COHERENT_POOL select DMA_NONCOHERENT_MMAP +# +# Fallback to arch code for DMA allocations. This should eventually go away. +# +config ARCH_HAS_DMA_ALLOC + depends on !ARCH_HAS_DMA_SET_UNCACHED + depends on !DMA_DIRECT_REMAP + depends on !DMA_GLOBAL_POOL + bool + config DMA_CMA bool "DMA Contiguous Memory Allocator" depends on HAVE_DMA_CONTIGUOUS && CMA |