Re: [PATCH v5] dma-debug: New interfaces to debug dma mapping errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-10-09 at 14:06 -0700, Andrew Morton wrote:
> On Mon, 08 Oct 2012 11:08:06 -0600
> Shuah Khan <shuah.khan@xxxxxx> wrote:
> 
> > 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@xxxxxx>
> > ---
> >  Documentation/DMA-API.txt          |   12 ++++++
> >  arch/x86/include/asm/dma-mapping.h |    1 +
> >  include/linux/dma-debug.h          |    7 ++++
> >  lib/dma-debug.c                    |   71 ++++++++++++++++++++++++++++++++++--
> 
> Third time lucky ... we still haven't fixed Documentation/DMA-API-HOWTO.txt!
> 
> Please, go through it and update it to show people how to correctly use
> these APIs.

Yes. Still on my list. I am working on the documentation changes. I am
planning to add usage examples that include calls to dma_mapping_error()
after dma_map_[page/single] calls and programming mistakes to watch out
for such as missing unmaps from  error legs etc.

-- Shuah


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux