xref: /linux-6.15/kernel/dma/Kconfig (revision 347cb6af)
1cf65a0f6SChristoph Hellwig
2cf65a0f6SChristoph Hellwigconfig HAS_DMA
3cf65a0f6SChristoph Hellwig	bool
4cf65a0f6SChristoph Hellwig	depends on !NO_DMA
5cf65a0f6SChristoph Hellwig	default y
6cf65a0f6SChristoph Hellwig
7cf65a0f6SChristoph Hellwigconfig NEED_SG_DMA_LENGTH
8cf65a0f6SChristoph Hellwig	bool
9cf65a0f6SChristoph Hellwig
10cf65a0f6SChristoph Hellwigconfig NEED_DMA_MAP_STATE
11cf65a0f6SChristoph Hellwig	bool
12cf65a0f6SChristoph Hellwig
13cf65a0f6SChristoph Hellwigconfig ARCH_DMA_ADDR_T_64BIT
14cf65a0f6SChristoph Hellwig	def_bool 64BIT || PHYS_ADDR_T_64BIT
15cf65a0f6SChristoph Hellwig
16f3ecc0ffSChristoph Hellwigconfig ARCH_HAS_DMA_COHERENCE_H
17f3ecc0ffSChristoph Hellwig	bool
18f3ecc0ffSChristoph Hellwig
19cf65a0f6SChristoph Hellwigconfig HAVE_GENERIC_DMA_COHERENT
20cf65a0f6SChristoph Hellwig	bool
21cf65a0f6SChristoph Hellwig
22*347cb6afSChristoph Hellwigconfig ARCH_HAS_SETUP_DMA_OPS
23*347cb6afSChristoph Hellwig	bool
24*347cb6afSChristoph Hellwig
25cf65a0f6SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_DEVICE
26cf65a0f6SChristoph Hellwig	bool
27cf65a0f6SChristoph Hellwig
28cf65a0f6SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_CPU
29cf65a0f6SChristoph Hellwig	bool
30cf65a0f6SChristoph Hellwig	select NEED_DMA_MAP_STATE
31cf65a0f6SChristoph Hellwig
32684f7e91SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
33684f7e91SChristoph Hellwig	bool
34684f7e91SChristoph Hellwig
3558b04406SChristoph Hellwigconfig ARCH_HAS_DMA_COHERENT_TO_PFN
3658b04406SChristoph Hellwig	bool
3758b04406SChristoph Hellwig
3858b04406SChristoph Hellwigconfig ARCH_HAS_DMA_MMAP_PGPROT
3958b04406SChristoph Hellwig	bool
4058b04406SChristoph Hellwig
41cf65a0f6SChristoph Hellwigconfig DMA_NONCOHERENT_CACHE_SYNC
42cf65a0f6SChristoph Hellwig	bool
43cf65a0f6SChristoph Hellwig
44cf65a0f6SChristoph Hellwigconfig DMA_VIRT_OPS
45cf65a0f6SChristoph Hellwig	bool
46cf65a0f6SChristoph Hellwig	depends on HAS_DMA
47cf65a0f6SChristoph Hellwig
48cf65a0f6SChristoph Hellwigconfig SWIOTLB
49cf65a0f6SChristoph Hellwig	bool
50cf65a0f6SChristoph Hellwig	select NEED_DMA_MAP_STATE
51f0edfea8SChristoph Hellwig
52f0edfea8SChristoph Hellwigconfig DMA_REMAP
53f0edfea8SChristoph Hellwig	depends on MMU
54f0edfea8SChristoph Hellwig	bool
550c3b3171SChristoph Hellwig
560c3b3171SChristoph Hellwigconfig DMA_DIRECT_REMAP
570c3b3171SChristoph Hellwig	bool
580c3b3171SChristoph Hellwig	select DMA_REMAP
5970ca7ba2SAndy Shevchenko
6070ca7ba2SAndy Shevchenkoconfig DMA_API_DEBUG
6170ca7ba2SAndy Shevchenko	bool "Enable debugging of DMA-API usage"
6270ca7ba2SAndy Shevchenko	select NEED_DMA_MAP_STATE
6370ca7ba2SAndy Shevchenko	help
6470ca7ba2SAndy Shevchenko	  Enable this option to debug the use of the DMA API by device drivers.
6570ca7ba2SAndy Shevchenko	  With this option you will be able to detect common bugs in device
6670ca7ba2SAndy Shevchenko	  drivers like double-freeing of DMA mappings or freeing mappings that
6770ca7ba2SAndy Shevchenko	  were never allocated.
6870ca7ba2SAndy Shevchenko
6970ca7ba2SAndy Shevchenko	  This also attempts to catch cases where a page owned by DMA is
7070ca7ba2SAndy Shevchenko	  accessed by the cpu in a way that could cause data corruption.  For
7170ca7ba2SAndy Shevchenko	  example, this enables cow_user_page() to check that the source page is
7270ca7ba2SAndy Shevchenko	  not undergoing DMA.
7370ca7ba2SAndy Shevchenko
7470ca7ba2SAndy Shevchenko	  This option causes a performance degradation.  Use only if you want to
7570ca7ba2SAndy Shevchenko	  debug device drivers and dma interactions.
7670ca7ba2SAndy Shevchenko
7770ca7ba2SAndy Shevchenko	  If unsure, say N.
7870ca7ba2SAndy Shevchenko
7970ca7ba2SAndy Shevchenkoconfig DMA_API_DEBUG_SG
8070ca7ba2SAndy Shevchenko	bool "Debug DMA scatter-gather usage"
8170ca7ba2SAndy Shevchenko	default y
8270ca7ba2SAndy Shevchenko	depends on DMA_API_DEBUG
8370ca7ba2SAndy Shevchenko	help
8470ca7ba2SAndy Shevchenko	  Perform extra checking that callers of dma_map_sg() have respected the
8570ca7ba2SAndy Shevchenko	  appropriate segment length/boundary limits for the given device when
8670ca7ba2SAndy Shevchenko	  preparing DMA scatterlists.
8770ca7ba2SAndy Shevchenko
8870ca7ba2SAndy Shevchenko	  This is particularly likely to have been overlooked in cases where the
8970ca7ba2SAndy Shevchenko	  dma_map_sg() API is used for general bulk mapping of pages rather than
9070ca7ba2SAndy Shevchenko	  preparing literal scatter-gather descriptors, where there is a risk of
9170ca7ba2SAndy Shevchenko	  unexpected behaviour from DMA API implementations if the scatterlist
9270ca7ba2SAndy Shevchenko	  is technically out-of-spec.
9370ca7ba2SAndy Shevchenko
9470ca7ba2SAndy Shevchenko	  If unsure, say N.
95