<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/dma-debug.c, branch v3.8.10</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.8.10</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.8.10'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-11-17T12:06:41Z</updated>
<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>
<entry>
<title>lib: dma-debug needs export.h for EXPORT_SYMBOL</title>
<updated>2011-10-31T23:32:23Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-07-01T20:23:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=23a7bfae6e19cb428da75804e5c4dfd67cd9ae8f'/>
<id>urn:sha1:23a7bfae6e19cb428da75804e5c4dfd67cd9ae8f</id>
<content type='text'>
There are no modular calls here, so just the minimal header for
the EXPORT_SYMBOL macro will suffice.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: hash_bucket_find needs to allow for offsets within an entry</title>
<updated>2011-08-23T13:36:00Z</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2011-08-08T19:13:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c6a21d0b8d667f403bc6186ef215a504a26ab682'/>
<id>urn:sha1:c6a21d0b8d667f403bc6186ef215a504a26ab682</id>
<content type='text'>
Summary:
Users of the pci_dma_sync_single_* api allow users to sync address ranges within
the range of a mapped entry (i.e. you can dma map address X to dma_addr_t A and
then pci_dma_sync_single on dma_addr_t A+1.  The dma-debug library however
assume dma syncs will always occur using the base address of a mapped region,
and uses that assumption to find entries in its hash table.  Since thats often
(but not always the case), the dma debug library can give us false errors about
missing entries, which are reported as syncing of memory not allocated by the
driver.  This was noted in the cxgb3 driver as this error:

WARNING: at lib/dma-debug.c:902 check_sync+0xdd/0x48c()
Hardware name: To be filled by O.E.M.
cxgb3 0000:01:00.0: DMA-API: device driver tries to sync DMA memory it has not
allocated [device address=0x00000000fff97800] [size=1984 bytes]
Modules linked in: autofs4 sunrpc cpufreq_ondemand acpi_cpufreq freq_table
mperf ip6t_REJECT nf_conntrack_ipv6 ip6table_filter ip6_tables ipv6 uinput
snd_hda_codec_intelhdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec
snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer e1000e snd soundcore r8169
cxgb3 iTCO_wdt snd_page_alloc mii shpchp i2c_i801 iTCO_vendor_support mdio
microcode firewire_ohci firewire_core crc_itu_t ata_generic pata_acpi i915
drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded:
scsi_wait_scan]
Pid: 1818, comm: ifconfig Not tainted 2.6.35-0.23.rc3.git6.fc14.x86_64 #1
Call Trace:
[&lt;ffffffff81050f71&gt;] warn_slowpath_common+0x85/0x9d
[&lt;ffffffff8105102c&gt;] warn_slowpath_fmt+0x46/0x48
[&lt;ffffffff8124658e&gt;] ? check_sync+0x39/0x48c
[&lt;ffffffff8107c470&gt;] ? trace_hardirqs_on+0xd/0xf
[&lt;ffffffff81246632&gt;] check_sync+0xdd/0x48c
[&lt;ffffffff81246ca6&gt;] debug_dma_sync_single_for_device+0x3f/0x41
[&lt;ffffffffa011615c&gt;] ? pci_map_page+0x84/0x97 [cxgb3]
[&lt;ffffffffa0117bc3&gt;] pci_dma_sync_single_for_device.clone.0+0x65/0x6e [cxgb3]
[&lt;ffffffffa0117ed1&gt;] refill_fl+0x305/0x30a [cxgb3]
[&lt;ffffffffa011857d&gt;] t3_sge_alloc_qset+0x6a7/0x821 [cxgb3]
[&lt;ffffffffa010a07b&gt;] cxgb_up+0x4d0/0xe62 [cxgb3]
[&lt;ffffffff81086037&gt;] ? __module_text_address+0x12/0x58
[&lt;ffffffffa010aa4c&gt;] cxgb_open+0x3f/0x309 [cxgb3]
[&lt;ffffffff813e9f6c&gt;] __dev_open+0x8e/0xbc
[&lt;ffffffff813e7ca5&gt;] __dev_change_flags+0xbe/0x142
[&lt;ffffffff813e9ea8&gt;] dev_change_flags+0x21/0x57
[&lt;ffffffff81445937&gt;] devinet_ioctl+0x29a/0x54b
[&lt;ffffffff811f9a87&gt;] ? inode_has_perm+0xaa/0xce
[&lt;ffffffff81446ed2&gt;] inet_ioctl+0x8f/0xa7
[&lt;ffffffff813d683a&gt;] sock_do_ioctl+0x29/0x48
[&lt;ffffffff813d6c83&gt;] sock_ioctl+0x213/0x222
[&lt;ffffffff81137f78&gt;] vfs_ioctl+0x32/0xa6
[&lt;ffffffff811384e2&gt;] do_vfs_ioctl+0x47a/0x4b3
[&lt;ffffffff81138571&gt;] sys_ioctl+0x56/0x79
[&lt;ffffffff81009c32&gt;] system_call_fastpath+0x16/0x1b
---[ end trace 69a4d4cc77b58004 ]---

(some edits by Joerg Roedel)

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Reported-by: Jay Fenalson &lt;fenlason@redhat.com&gt;
CC: Divy LeRay &lt;divy@chelsio.com&gt;
CC: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
CC: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
CC: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
</feed>
