Re: [PATCH] dma-debug: Add dma map/unmap error tracking support

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

 



On Tue, Sep 04, 2012 at 04:57:56PM -0600, Shuah Khan wrote:
> On Tue, 2012-09-04 at 17:05 -0400, Konrad Rzeszutek Wilk wrote:
> > On Sun, Sep 02, 2012 at 08:14:17AM -0600, Shuah Khan wrote:
> > > A recent dma mapping error analysis effort showed that a large precentage
> > > of dma_map_single() and dma_map_page() returns are not checked for mapping
> > > errors. Reference: https://lkml.org/lkml/2012/8/10/326
> > > 
> > 
> > So were you able to catch some naughty drivers with this?
> 
> I did compile a complete list of drivers that don't check dma mapping
> errors from my analysis. Are you interested in seeing the full analysis?

Yes, plus the authors of the drivers are probably interested in it as
well.
..snip..
> > I was initially thinking that this patch would contain a state for the driver
> > of whether after map it has called dma_mapping_error. So this function would
> > increment some internal state, and if dma_mapping_error on that specific dma_addr
> > it would decrement it. If it never occured, then we would print on the unmap
> > that the device never had called dma_mapping_error on said dma_addr?
> 
> That is a good idea. Let me see if I understand what you are saying
> correctly. Add a new field to dma_debug_entry structure and keep state
> and clear it if dma_mapping_error() is called. This will require adding
> a debug interface for dma_mapping_error() which is not hard to do. Is
> this close to what you are thinking?

Right. It is more complex than this patch but it should provide a nicer
"trap" mechanism to alert driver writers that they are not checking DMA
addresses properly.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux