Skip to content

Commit 70ca7ba

Browse files
andy-shevChristoph Hellwig
authored andcommitted
dma-mapping: move debug configuration options to kernel/dma
This is a follow up to the commit cf65a0f ("dma-mapping: move all DMA mapping code to kernel/dma") which moved source code of DMA API to kernel/dma folder. Since there is no file left in the lib that require DMA API debugging options move the latter to kernel/dma as well. Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 0a3b192 commit 70ca7ba

2 files changed

Lines changed: 36 additions & 36 deletions

File tree

‎kernel/dma/Kconfig‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,39 @@ config DMA_REMAP
5353
config DMA_DIRECT_REMAP
5454
bool
5555
select DMA_REMAP
56+
57+
config DMA_API_DEBUG
58+
bool "Enable debugging of DMA-API usage"
59+
select NEED_DMA_MAP_STATE
60+
help
61+
Enable this option to debug the use of the DMA API by device drivers.
62+
With this option you will be able to detect common bugs in device
63+
drivers like double-freeing of DMA mappings or freeing mappings that
64+
were never allocated.
65+
66+
This also attempts to catch cases where a page owned by DMA is
67+
accessed by the cpu in a way that could cause data corruption. For
68+
example, this enables cow_user_page() to check that the source page is
69+
not undergoing DMA.
70+
71+
This option causes a performance degradation. Use only if you want to
72+
debug device drivers and dma interactions.
73+
74+
If unsure, say N.
75+
76+
config DMA_API_DEBUG_SG
77+
bool "Debug DMA scatter-gather usage"
78+
default y
79+
depends on DMA_API_DEBUG
80+
help
81+
Perform extra checking that callers of dma_map_sg() have respected the
82+
appropriate segment length/boundary limits for the given device when
83+
preparing DMA scatterlists.
84+
85+
This is particularly likely to have been overlooked in cases where the
86+
dma_map_sg() API is used for general bulk mapping of pages rather than
87+
preparing literal scatter-gather descriptors, where there is a risk of
88+
unexpected behaviour from DMA API implementations if the scatterlist
89+
is technically out-of-spec.
90+
91+
If unsure, say N.

‎lib/Kconfig.debug‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,42 +1655,6 @@ config PROVIDE_OHCI1394_DMA_INIT
16551655

16561656
See Documentation/debugging-via-ohci1394.txt for more information.
16571657

1658-
config DMA_API_DEBUG
1659-
bool "Enable debugging of DMA-API usage"
1660-
select NEED_DMA_MAP_STATE
1661-
help
1662-
Enable this option to debug the use of the DMA API by device drivers.
1663-
With this option you will be able to detect common bugs in device
1664-
drivers like double-freeing of DMA mappings or freeing mappings that
1665-
were never allocated.
1666-
1667-
This also attempts to catch cases where a page owned by DMA is
1668-
accessed by the cpu in a way that could cause data corruption. For
1669-
example, this enables cow_user_page() to check that the source page is
1670-
not undergoing DMA.
1671-
1672-
This option causes a performance degradation. Use only if you want to
1673-
debug device drivers and dma interactions.
1674-
1675-
If unsure, say N.
1676-
1677-
config DMA_API_DEBUG_SG
1678-
bool "Debug DMA scatter-gather usage"
1679-
default y
1680-
depends on DMA_API_DEBUG
1681-
help
1682-
Perform extra checking that callers of dma_map_sg() have respected the
1683-
appropriate segment length/boundary limits for the given device when
1684-
preparing DMA scatterlists.
1685-
1686-
This is particularly likely to have been overlooked in cases where the
1687-
dma_map_sg() API is used for general bulk mapping of pages rather than
1688-
preparing literal scatter-gather descriptors, where there is a risk of
1689-
unexpected behaviour from DMA API implementations if the scatterlist
1690-
is technically out-of-spec.
1691-
1692-
If unsure, say N.
1693-
16941658
menuconfig RUNTIME_TESTING_MENU
16951659
bool "Runtime Testing"
16961660
def_bool y

0 commit comments

Comments
 (0)