]> www.infradead.org Git - users/hch/misc.git/commitdiff
dma-debug: remove DMA_API_DEBUG_SG dma-debug
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Oct 2024 08:29:20 +0000 (10:29 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 16 Oct 2024 03:46:31 +0000 (05:46 +0200)
The scatterlist validity checks are pretty simple and cheap, perform them
unconditionally.

Signed-off-by: Christoph Hellwig <hch@lst.de>
kernel/dma/Kconfig
kernel/dma/debug.c

index 4c0dcd90912167443ae28d6c3c7303cade17a487..31cfdb6b4bc3e33c239111955d97b3ec160baafa 100644 (file)
@@ -260,23 +260,6 @@ config DMA_API_DEBUG
 
          If unsure, say N.
 
-config DMA_API_DEBUG_SG
-       bool "Debug DMA scatter-gather usage"
-       default y
-       depends on DMA_API_DEBUG
-       help
-         Perform extra checking that callers of dma_map_sg() have respected the
-         appropriate segment length/boundary limits for the given device when
-         preparing DMA scatterlists.
-
-         This is particularly likely to have been overlooked in cases where the
-         dma_map_sg() API is used for general bulk mapping of pages rather than
-         preparing literal scatter-gather descriptors, where there is a risk of
-         unexpected behaviour from DMA API implementations if the scatterlist
-         is technically out-of-spec.
-
-         If unsure, say N.
-
 config DMA_MAP_BENCHMARK
        bool "Enable benchmarking of streaming DMA mapping"
        depends on DEBUG_FS
index e1da50a36bdc04362f1368872a4947a1174ca6c5..2717f1c22510a4902d9b2fac1ac48eebe2ee5865 100644 (file)
@@ -1159,7 +1159,6 @@ out:
 
 static void check_sg_segment(struct device *dev, struct scatterlist *sg)
 {
-#ifdef CONFIG_DMA_API_DEBUG_SG
        unsigned int max_seg = dma_get_max_seg_size(dev);
        u64 start, end, boundary = dma_get_seg_boundary(dev);
 
@@ -1180,7 +1179,6 @@ static void check_sg_segment(struct device *dev, struct scatterlist *sg)
        if ((start ^ end) & ~boundary)
                err_printk(dev, NULL, "mapping sg segment across boundary [start=0x%016llx] [end=0x%016llx] [boundary=0x%016llx]\n",
                           start, end, boundary);
-#endif
 }
 
 void debug_dma_map_single(struct device *dev, const void *addr,