]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
dma-debug: new interfaces to debug dma mapping errors
authorShuah Khan <shuah.khan@hp.com>
Fri, 12 Oct 2012 04:23:05 +0000 (15:23 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 22 Oct 2012 04:01:12 +0000 (15:01 +1100)
commitcf7b94fd7f768ac6001d684d1217cc25246c90a8
treec6b36133353b562b60dfd98dfc0dc3777bfbc334
parent522158b5c9875d789aa6d39c95e0d0d0c5833b91
dma-debug: new interfaces to debug dma mapping errors

Add dma-debug interface debug_dma_mapping_error() to debug drivers that
fail to check dma mapping errors on addresses returned by dma_map_single()
and dma_map_page() interfaces.  This interface clears a flag set by
debug_dma_map_page() to indicate that dma_mapping_error() has been called
by the driver.  When driver does unmap, debug_dma_unmap() checks the flag
and if this flag is still set, prints warning message that includes call
trace that leads up to the unmap.  This interface can be called from
dma_mapping_error() routines to enable dma mapping error check debugging.

Tested: Intel iommu and swiotlb (iommu=soft) on x86-64 with
        CONFIG_DMA_API_DEBUG enabled and disabled.

Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/DMA-API.txt
arch/x86/include/asm/dma-mapping.h
include/linux/dma-debug.h
lib/dma-debug.c