<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/dma-debug.c, branch v3.9.7</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9.7</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9.7'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-03-22T23:41:20Z</updated>
<entry>
<title>dma-debug: update DMA debug API to better handle multiple mappings of a buffer</title>
<updated>2013-03-22T23:41:20Z</updated>
<author>
<name>Alexander Duyck</name>
<email>alexander.h.duyck@intel.com</email>
</author>
<published>2013-03-22T22:04:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=96e7d7a1e0fc7780b4c1981c787e42473aa91a95'/>
<id>urn:sha1:96e7d7a1e0fc7780b4c1981c787e42473aa91a95</id>
<content type='text'>
There were reports of the igb driver unmapping buffers without calling
dma_mapping_error.  On closer inspection issues were found in the DMA
debug API and how it handled multiple mappings of the same buffer.

The issue I found is the fact that the debug_dma_mapping_error would
only set the map_err_type to MAP_ERR_CHECKED in the case that the was
only one match for device and device address.  However in the case of
non-IOMMU, multiple addresses existed and as a result it was not setting
this field once a second mapping was instantiated.  I have resolved this
by changing the search so that it instead will now set MAP_ERR_CHECKED
on the first buffer that matches the device and DMA address that is
currently in the state MAP_ERR_NOT_CHECKED.

A secondary side effect of this patch is that in the case of multiple
buffers using the same address only the last mapping will have a valid
map_err_type.  The previous mappings will all end up with map_err_type
set to MAP_ERR_CHECKED because of the dma_mapping_error call in
debug_dma_map_page.  However this behavior may be preferable as it means
you will likely only see one real error per multi-mapped buffer, versus
the current behavior of multiple false errors mer multi-mapped buffer.

Signed-off-by: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;
Cc: Joerg Roedel &lt;joro@8bytes.org&gt;
Reviewed-by: Shuah Khan &lt;shuah.khan@hp.com&gt;
Tested-by: Shuah Khan &lt;shuah.khan@hp.com&gt;
Cc: Jakub Kicinski &lt;kubakici@wp.pl&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>dma-debug: fix locking bug in check_unmap()</title>
<updated>2013-03-22T23:41:20Z</updated>
<author>
<name>Alexander Duyck</name>
<email>alexander.h.duyck@intel.com</email>
</author>
<published>2013-03-22T22:04:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8d640a51ec9e9cdefa680b67ad55f933eefc5923'/>
<id>urn:sha1:8d640a51ec9e9cdefa680b67ad55f933eefc5923</id>
<content type='text'>
In check_unmap() it is possible to get into a dead-locked state if
dma_mapping_error is called.  The problem is that the bucket is locked in
check_unmap, and locked again by debug_dma_mapping_error which is called
by dma_mapping_error.  To resolve that we must release the lock on the
bucket before making the call to dma_mapping_error.

[akpm@linux-foundation.org: restore 80-col trickery to be consistent with the rest of the file]
Signed-off-by: Alexander Duyck &lt;alexander.h.duyck@intel.com&gt;
Cc: Joerg Roedel &lt;joro@8bytes.org&gt;
Reviewed-by: Shuah Khan &lt;shuah.khan@hp.com&gt;
Tested-by: Shuah Khan &lt;shuah.khan@hp.com&gt;
Cc: Jakub Kicinski &lt;kubakici@wp.pl&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>dma-debug: fix to not have dependency on get_dma_ops() interface</title>
<updated>2012-11-17T12:06:41Z</updated>
<author>
<name>Shuah Khan</name>
<email>shuah.khan@hp.com</email>
</author>
<published>2012-11-03T23:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bfe0fb0f1a570ae72680d6d48655c98d1f4733f5'/>
<id>urn:sha1:bfe0fb0f1a570ae72680d6d48655c98d1f4733f5</id>
<content type='text'>
dma-debug depends on get_dma_ops() interface. Several architectures
do not define dma_ops and get_dma_ops(). When dma debug interfaces are
used on an architecture (e.g: c6x) that doesn't define get_dmap_ops(),
compilation fails. Changing dma-debug to call dma_mapping_error() instead
of defining its own that calls get_dma_ops(), such that the internal use of
dma_mapping_error() doesn't interfere with the debug_dma_mapping_error()
interface's mapping error checks. Moving dma_mapping_error() checks in
check_unmap() under the dma debug entry not found is sufficient to fix the
problem.

Reference: https://lkml.org/lkml/2012/10/26/367

Signed-off-by: Shuah Khan &lt;shuah.khan@hp.com&gt;
Reported-by: Mark Salter &lt;msalter@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;joro@8bytes.org&gt;
</content>
</entry>
<entry>
<title>dma-debug: New interfaces to debug dma mapping errors</title>
<updated>2012-10-24T15:06:43Z</updated>
<author>
<name>Shuah Khan</name>
<email>shuah.khan@hp.com</email>
</author>
<published>2012-10-08T17:08:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6c9c6d6301287e369a754d628230fa6e50cdb74b'/>
<id>urn:sha1:6c9c6d6301287e369a754d628230fa6e50cdb74b</id>
<content type='text'>
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 &lt;shuah.khan@hp.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>lib/dma-debug.c: fix __hash_bucket_find()</title>
<updated>2012-10-19T21:07:48Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2012-10-19T20:57:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fe73fbe1c5eda709084dedb66cbdd4b86826cce7'/>
<id>urn:sha1:fe73fbe1c5eda709084dedb66cbdd4b86826cce7</id>
<content type='text'>
If there is only one match, the unique matched entry should be returned.

Without the fix, the upcoming dma debug interfaces ("dma-debug: new
interfaces to debug dma mapping errors") can't work reliably because
only device and dma_addr are passed to dma_mapping_error().

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Reported-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
Cc: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
Tested-by: Shuah Khan &lt;shuah.khan@hp.com&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Cc: Jakub Kicinski &lt;kubakici@wp.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>dma-debug: Remove local BUS_NOTIFY_UNBOUND_DRIVER define</title>
<updated>2012-10-02T10:10:27Z</updated>
<author>
<name>Shuah Khan</name>
<email>shuah.khan@hp.com</email>
</author>
<published>2012-10-01T18:48:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=759643ce39f13c416236e2609ccaed9792107b2f'/>
<id>urn:sha1:759643ce39f13c416236e2609ccaed9792107b2f</id>
<content type='text'>
Remove local BUS_NOTIFY_UNBOUND_DRIVER define. This is not used since
BUS_NOTIFY_UNBOUND_DRIVER is defined in include/linux/device.h

Signed-off-by: Shuah Khan &lt;shuah.khan@hp.com&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: debugfs_create_bool() takes a u32 pointer</title>
<updated>2012-07-02T10:11:40Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-06-27T09:08:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=68ee6d22376411f8ec668413f1b632a34192a807'/>
<id>urn:sha1:68ee6d22376411f8ec668413f1b632a34192a807</id>
<content type='text'>
Even though it has "bool" in the name, you have pass a u32 pointer to
debugfs_create_bool().  Otherwise you get memory corruption in
write_file_bool().  Fortunately in this case the corruption happens in
an alignment hole between variables so it doesn't cause any problems.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: release free_entries_lock before saving stack trace</title>
<updated>2012-04-12T10:28:46Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kubakici@wp.pl</email>
</author>
<published>2012-04-04T01:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=29cdd4e4ec91aae239192bb122d377d15a9d75e3'/>
<id>urn:sha1:29cdd4e4ec91aae239192bb122d377d15a9d75e3</id>
<content type='text'>
Saving stack trace can take a while and once the entry
is allocated free_entries_lock is no longer needed.

Signed-off-by: Jakub Kicinski &lt;kubakici@wp.pl&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>Remove useless get_driver()/put_driver() calls</title>
<updated>2012-01-25T00:00:35Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2012-01-24T18:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f3ff9247088a0af0c192a28908dab76ff3d8871f'/>
<id>urn:sha1:f3ff9247088a0af0c192a28908dab76ff3d8871f</id>
<content type='text'>
As part of the removal of get_driver()/put_driver(), this patch
(as1512) gets rid of various useless and unnecessary calls in several
drivers.  In some cases it may be desirable to pin the driver by
calling try_module_get(), but that can be done later.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: "David S. Miller" &lt;davem@davemloft.net&gt;
CC: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
CC: Michael Buesch &lt;m@bues.ch&gt;
CC: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>Fix comparison using wrong pointer variable in dma debug code</title>
<updated>2011-11-21T10:35:37Z</updated>
<author>
<name>Thomas Jarosch</name>
<email>thomas.jarosch@intra2net.com</email>
</author>
<published>2011-11-17T19:31:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=91ec37cc1015220965e39bf342fb846810d19e79'/>
<id>urn:sha1:91ec37cc1015220965e39bf342fb846810d19e79</id>
<content type='text'>
cppcheck reported:
[lib/dma-debug.c:248] -&gt; [lib/dma-debug.c:248]: (style) Same expression on both sides of '=='.

Signed-off-by: Thomas Jarosch &lt;thomas.jarosch@intra2net.com&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
</feed>
