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 22cf65a0f6SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_DEVICE 23cf65a0f6SChristoph Hellwig bool 24cf65a0f6SChristoph Hellwig 25cf65a0f6SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_CPU 26cf65a0f6SChristoph Hellwig bool 27cf65a0f6SChristoph Hellwig select NEED_DMA_MAP_STATE 28cf65a0f6SChristoph Hellwig 29684f7e91SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_CPU_ALL 30684f7e91SChristoph Hellwig bool 31684f7e91SChristoph Hellwig 3258b04406SChristoph Hellwigconfig ARCH_HAS_DMA_COHERENT_TO_PFN 3358b04406SChristoph Hellwig bool 3458b04406SChristoph Hellwig 3558b04406SChristoph Hellwigconfig ARCH_HAS_DMA_MMAP_PGPROT 3658b04406SChristoph Hellwig bool 3758b04406SChristoph Hellwig 38cf65a0f6SChristoph Hellwigconfig DMA_NONCOHERENT_CACHE_SYNC 39cf65a0f6SChristoph Hellwig bool 40cf65a0f6SChristoph Hellwig 41cf65a0f6SChristoph Hellwigconfig DMA_VIRT_OPS 42cf65a0f6SChristoph Hellwig bool 43cf65a0f6SChristoph Hellwig depends on HAS_DMA 44cf65a0f6SChristoph Hellwig 45cf65a0f6SChristoph Hellwigconfig SWIOTLB 46cf65a0f6SChristoph Hellwig bool 47cf65a0f6SChristoph Hellwig select NEED_DMA_MAP_STATE 48f0edfea8SChristoph Hellwig 49f0edfea8SChristoph Hellwigconfig DMA_REMAP 50f0edfea8SChristoph Hellwig depends on MMU 51f0edfea8SChristoph Hellwig bool 520c3b3171SChristoph Hellwig 530c3b3171SChristoph Hellwigconfig DMA_DIRECT_REMAP 540c3b3171SChristoph Hellwig bool 550c3b3171SChristoph Hellwig select DMA_REMAP 56*70ca7ba2SAndy Shevchenko 57*70ca7ba2SAndy Shevchenkoconfig DMA_API_DEBUG 58*70ca7ba2SAndy Shevchenko bool "Enable debugging of DMA-API usage" 59*70ca7ba2SAndy Shevchenko select NEED_DMA_MAP_STATE 60*70ca7ba2SAndy Shevchenko help 61*70ca7ba2SAndy Shevchenko Enable this option to debug the use of the DMA API by device drivers. 62*70ca7ba2SAndy Shevchenko With this option you will be able to detect common bugs in device 63*70ca7ba2SAndy Shevchenko drivers like double-freeing of DMA mappings or freeing mappings that 64*70ca7ba2SAndy Shevchenko were never allocated. 65*70ca7ba2SAndy Shevchenko 66*70ca7ba2SAndy Shevchenko This also attempts to catch cases where a page owned by DMA is 67*70ca7ba2SAndy Shevchenko accessed by the cpu in a way that could cause data corruption. For 68*70ca7ba2SAndy Shevchenko example, this enables cow_user_page() to check that the source page is 69*70ca7ba2SAndy Shevchenko not undergoing DMA. 70*70ca7ba2SAndy Shevchenko 71*70ca7ba2SAndy Shevchenko This option causes a performance degradation. Use only if you want to 72*70ca7ba2SAndy Shevchenko debug device drivers and dma interactions. 73*70ca7ba2SAndy Shevchenko 74*70ca7ba2SAndy Shevchenko If unsure, say N. 75*70ca7ba2SAndy Shevchenko 76*70ca7ba2SAndy Shevchenkoconfig DMA_API_DEBUG_SG 77*70ca7ba2SAndy Shevchenko bool "Debug DMA scatter-gather usage" 78*70ca7ba2SAndy Shevchenko default y 79*70ca7ba2SAndy Shevchenko depends on DMA_API_DEBUG 80*70ca7ba2SAndy Shevchenko help 81*70ca7ba2SAndy Shevchenko Perform extra checking that callers of dma_map_sg() have respected the 82*70ca7ba2SAndy Shevchenko appropriate segment length/boundary limits for the given device when 83*70ca7ba2SAndy Shevchenko preparing DMA scatterlists. 84*70ca7ba2SAndy Shevchenko 85*70ca7ba2SAndy Shevchenko This is particularly likely to have been overlooked in cases where the 86*70ca7ba2SAndy Shevchenko dma_map_sg() API is used for general bulk mapping of pages rather than 87*70ca7ba2SAndy Shevchenko preparing literal scatter-gather descriptors, where there is a risk of 88*70ca7ba2SAndy Shevchenko unexpected behaviour from DMA API implementations if the scatterlist 89*70ca7ba2SAndy Shevchenko is technically out-of-spec. 90*70ca7ba2SAndy Shevchenko 91*70ca7ba2SAndy Shevchenko If unsure, say N. 92