]> git.karo-electronics.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>
Fri, 19 Oct 2012 02:09:29 +0000 (13:09 +1100)
commitd41abb21ffb7129e1c637baed7b3e0e2cbff3e70
treecf2d61170e7c111732fb2b43fb66fee236e9a522
parent971eed29809fc2de29102b48a66cdccaf6ab9fa0
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