Skip to content

Commit 150745b

Browse files
author
Christoph Hellwig
committed
dma-debug: remove DMA_API_DEBUG_SG
The scatterlist validity checks are pretty simple and cheap, perform them unconditionally. Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 9d4f645 commit 150745b

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

kernel/dma/Kconfig

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,6 @@ config DMA_API_DEBUG
260260

261261
If unsure, say N.
262262

263-
config DMA_API_DEBUG_SG
264-
bool "Debug DMA scatter-gather usage"
265-
default y
266-
depends on DMA_API_DEBUG
267-
help
268-
Perform extra checking that callers of dma_map_sg() have respected the
269-
appropriate segment length/boundary limits for the given device when
270-
preparing DMA scatterlists.
271-
272-
This is particularly likely to have been overlooked in cases where the
273-
dma_map_sg() API is used for general bulk mapping of pages rather than
274-
preparing literal scatter-gather descriptors, where there is a risk of
275-
unexpected behaviour from DMA API implementations if the scatterlist
276-
is technically out-of-spec.
277-
278-
If unsure, say N.
279-
280263
config DMA_MAP_BENCHMARK
281264
bool "Enable benchmarking of streaming DMA mapping"
282265
depends on DEBUG_FS

kernel/dma/debug.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,6 @@ static void check_sync(struct device *dev,
11631163

11641164
static void check_sg_segment(struct device *dev, struct scatterlist *sg)
11651165
{
1166-
#ifdef CONFIG_DMA_API_DEBUG_SG
11671166
unsigned int max_seg = dma_get_max_seg_size(dev);
11681167
u64 start, end, boundary = dma_get_seg_boundary(dev);
11691168

@@ -1184,7 +1183,6 @@ static void check_sg_segment(struct device *dev, struct scatterlist *sg)
11841183
if ((start ^ end) & ~boundary)
11851184
err_printk(dev, NULL, "mapping sg segment across boundary [start=0x%016llx] [end=0x%016llx] [boundary=0x%016llx]\n",
11861185
start, end, boundary);
1187-
#endif
11881186
}
11891187

11901188
void debug_dma_map_single(struct device *dev, const void *addr,

0 commit comments

Comments
 (0)