<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/dma-debug.c, branch v2.6.32</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.32</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.32'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2009-10-29T15:25:50Z</updated>
<entry>
<title>dma-debug: Fix compile warning with PAE enabled</title>
<updated>2009-10-29T15:25:50Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2009-10-29T15:25:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59a40e70458341b35d123b60aca416a1d97ebbe3'/>
<id>urn:sha1:59a40e70458341b35d123b60aca416a1d97ebbe3</id>
<content type='text'>
When PAE is enabled in the kernel configuration the size of
phys_addr_t differs from the size of a void pointer. The gcc
prints a warning about that in dma-debug code.
This patch fixes the warning by converting the output to
unsigned long long instead of a pointer.

Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: Fix check_unmap null pointer dereference</title>
<updated>2009-08-21T08:04:24Z</updated>
<author>
<name>Kyle McMartin</name>
<email>kyle@redhat.com</email>
</author>
<published>2009-08-20T01:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec9c96ef3cc0124cb94375b17faaa8cff5dfdf97'/>
<id>urn:sha1:ec9c96ef3cc0124cb94375b17faaa8cff5dfdf97</id>
<content type='text'>
While it's debatable whether or not a NULL device argument to
the DMA API functions is valid... since it certainly isn't
valid on devices with an IOMMU... dma-debug really shouldn't be
dereferencing null pointers either.

Guard against that in err_printk and the driver_filter
functions. A Fedora rawhide user was seeing this in one of the
dvb drivers resulting in an oops on boot.

[ A patch has been sent for testing to the driver, but I feel
  the dma debugging support should be fixed as well. (There's
  still a pile of legacy garbage in the kernel passing null
  pointers to dma_{alloc,free}_*. :( ]

Signed-off-by: Kyle McMartin &lt;kyle@redhat.com&gt;
Cc: mchehab@infradead.org
Cc: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
LKML-Reference: &lt;20090820011708.GP25206@bombadil.infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>dma-debug: Fix the overlap() function to be correct and readable</title>
<updated>2009-07-10T20:18:45Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-07-10T19:38:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f39d1b9792881ce4eb982ec8cc65258bf95674b5'/>
<id>urn:sha1:f39d1b9792881ce4eb982ec8cc65258bf95674b5</id>
<content type='text'>
Linus noticed how unclean and buggy the overlap() function is:

 - It uses convoluted (and bug-causing) positive checks for
   range overlap - instead of using a more natural negative
   check.

 - Even the positive checks are buggy: a positive intersection
   check has four natural cases while we checked only for three,
   missing the (addr &lt; start &amp;&amp; addr2 == end) case for example.

 - The variables are mis-named, making it non-obvious how the
   check was done.

 - It needlessly uses u64 instead of unsigned long. Since these
   are kernel memory pointers and we explicitly exclude highmem
   ranges anyway we cannot ever overflow 32 bits, even if we
   could. (and on 64-bit it doesnt matter anyway)

All in one, this function needs a total revamp. I used Linus's
suggestions minus the paranoid checks (we cannot overflow really
because if we get totally bad DMA ranges passed far more things
break in the systems than just DMA debugging). I also fixed a
few other small details i noticed.

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>dma-debug: Put all hash-chain locks into the same lock class</title>
<updated>2009-06-17T14:26:04Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-06-16T14:11:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0a5b83ee0fce9dbf8ff5fe1f8c9ae7dfafe458c'/>
<id>urn:sha1:b0a5b83ee0fce9dbf8ff5fe1f8c9ae7dfafe458c</id>
<content type='text'>
Alan Cox reported that lockdep runs out of its stack-trace entries
with certain configs:

 BUG: MAX_STACK_TRACE_ENTRIES too low

This happens because there are 1024 hash buckets, each with a
separate lock. Lockdep puts each lock into a separate lock class and
tracks them independently.

But in reality we never take more than one of the buckets, so they
really belong into a single lock-class. Annotate the has bucket lock
init accordingly.

[ Impact: reduce the lockdep footprint of dma-debug ]

Reported-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: fix off-by-one error in overlap function</title>
<updated>2009-06-16T10:29:40Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2009-06-16T10:23:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c79ee4e466dd12347f112e2af306dca35198458f'/>
<id>urn:sha1:c79ee4e466dd12347f112e2af306dca35198458f</id>
<content type='text'>
This patch fixes a bug in the overlap function which returned true if
one region ends exactly before the second region begins. This is no
overlap but the function returned true in that case.

Cc: stable@kernel.org
Reported-by: Andrew Randrianasulu &lt;randrik@mail.ru&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: be more careful when building reference entries</title>
<updated>2009-06-15T09:10:14Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2009-06-12T13:25:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa010efb7b6cd0dfbea8ecf37a6ab587dc2a8560'/>
<id>urn:sha1:aa010efb7b6cd0dfbea8ecf37a6ab587dc2a8560</id>
<content type='text'>
The current code is not very careful when it builds reference
dma_debug_entries which get passed to hash_bucket_find(). But since this
function changed to a best-fit algorithm these entries have to be more
acurate. This patch adds this higher level of accuracy.

Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: check for sg_call_ents in best-fit algorithm too</title>
<updated>2009-06-15T09:08:54Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2009-06-11T08:03:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e5e8c5b90a1ae249930fcf7403f3757686cf1a7b'/>
<id>urn:sha1:e5e8c5b90a1ae249930fcf7403f3757686cf1a7b</id>
<content type='text'>
If we don't check for sg_call_ents the hash_bucket_find function might
still return the wrong dma_debug_entry for sg mappings.

Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: simplify logic in driver_filter()</title>
<updated>2009-06-08T13:53:46Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2009-06-08T13:53:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0bf841281e58d0b3cc9fe9dc4383df7694bde6bd'/>
<id>urn:sha1:0bf841281e58d0b3cc9fe9dc4383df7694bde6bd</id>
<content type='text'>
This patch makes the driver_filter function more readable by
reorganizing the code. The removal of a code code block to an upper
indentation level makes hard-to-read line-wraps unnecessary.

Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: disable/enable irqs only once in device_dma_allocations</title>
<updated>2009-06-08T13:46:19Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2009-06-08T13:46:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=be81c6ea23b8b471141734ef4bc005f5127aaf43'/>
<id>urn:sha1:be81c6ea23b8b471141734ef4bc005f5127aaf43</id>
<content type='text'>
There is no need to disable/enable irqs on each loop iteration. Just
disable irqs for the whole time the loop runs.

Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>dma-debug: use pr_* instead of printk(KERN_* ...)</title>
<updated>2009-06-08T13:39:24Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2009-06-08T13:39:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e7ed70eedccc78e79ce6da2155e9caf90aff4003'/>
<id>urn:sha1:e7ed70eedccc78e79ce6da2155e9caf90aff4003</id>
<content type='text'>
The pr_* macros are shorter than the old printk(KERN_ ...) variant.
Change the dma-debug code to use the new macros and save a few
unnecessary line breaks. If lines don't break the source code can also
be grepped more easily.

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