<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/lib, branch v2.6.27.56</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>percpu counter: clean up percpu_counter_sum_and_set()</title>
<updated>2010-05-26T21:27:05+00:00</updated>
<author>
<name>Mingming Cao</name>
<email>cmm@us.ibm.com</email>
</author>
<published>2010-03-16T00:25:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ac6016e3a8c7967cf8e3fe9102a9b87d7092b4bf'/>
<id>ac6016e3a8c7967cf8e3fe9102a9b87d7092b4bf</id>
<content type='text'>
commit 1f7c14c62ce63805f9574664a6c6de3633d4a354 upstream.

percpu_counter_sum_and_set() and percpu_counter_sum() is the same except
the former updates the global counter after accounting.  Since we are
taking the fbc-&gt;lock to calculate the precise value of the counter in
percpu_counter_sum() anyway, it should simply set fbc-&gt;count too, as the
percpu_counter_sum_and_set() does.

This patch merges these two interfaces into one.

Signed-off-by: Mingming Cao &lt;cmm@us.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Jayson R. King &lt;dev@jaysonking.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 1f7c14c62ce63805f9574664a6c6de3633d4a354 upstream.

percpu_counter_sum_and_set() and percpu_counter_sum() is the same except
the former updates the global counter after accounting.  Since we are
taking the fbc-&gt;lock to calculate the precise value of the counter in
percpu_counter_sum() anyway, it should simply set fbc-&gt;count too, as the
percpu_counter_sum_and_set() does.

This patch merges these two interfaces into one.

Signed-off-by: Mingming Cao &lt;cmm@us.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Jayson R. King &lt;dev@jaysonking.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: Select frame pointers on x86</title>
<updated>2009-07-02T23:31:50+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2009-06-12T08:04:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da4dec0d172d4a7e27d9530b5dd0c959d3af0a6f'/>
<id>da4dec0d172d4a7e27d9530b5dd0c959d3af0a6f</id>
<content type='text'>
commit 00540e5d54be972a94a3b2ce6da8621bebe731a2 upstream.

x86 stack traces are a piece of crap without frame pointers, and its not
like the 'performance gain' of not having stack pointers matters when you
selected lockdep.

Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 00540e5d54be972a94a3b2ce6da8621bebe731a2 upstream.

x86 stack traces are a piece of crap without frame pointers, and its not
like the 'performance gain' of not having stack pointers matters when you
selected lockdep.

Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>lib/idr.c: use kmem_cache_zalloc() for the idr_layer cache</title>
<updated>2009-01-25T00:36:23+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2009-01-15T21:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8576a5cb0ae831f4aca583674c36f4442646f7d9'/>
<id>8576a5cb0ae831f4aca583674c36f4442646f7d9</id>
<content type='text'>
commit 5b019e99016f3a692ba45bf68fba73a402d7c01a upstream.

David points out that the idr_remove_all() function returns unused slabs
to the kmem cache, but needs to zero them first or else they will be
uninitialized upon next use.  This causes crashes which have been observed
in the firewire subsystem.

He fixed this by zeroing the object before freeing it in idr_remove_all().

But we agree that simply removing the constructor and zeroing the object
at allocation time is simpler than relying upon slab constructor machinery
and might even be faster.

This problem was introduced by "idr: make idr_remove rcu-safe" (commit
cf481c20c476ad2c0febdace9ce23f5a4db19582), which was first released in
2.6.27.

There are no known codesites which trigger this bug in 2.6.27 or 2.6.28.
The post-2.6.28 firewire changes are the only known triggerer.

There might of course be not-yet-discovered triggerers in 2.6.27 and
2.6.28, and there might be out-of-tree triggerers which are added to those
kernel versions.  I'll let the -stable guys decide whether they want to
backport this fix.

Reported-by: David Moore &lt;dcm@acm.org&gt;
Cc: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Cc: Nadia Derbey &lt;Nadia.Derbey@bull.net&gt;
Cc: Paul E. McKenney &lt;paulmck@us.ibm.com&gt;
Cc: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Cc: Kristian Hgsberg &lt;krh@redhat.com&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5b019e99016f3a692ba45bf68fba73a402d7c01a upstream.

David points out that the idr_remove_all() function returns unused slabs
to the kmem cache, but needs to zero them first or else they will be
uninitialized upon next use.  This causes crashes which have been observed
in the firewire subsystem.

He fixed this by zeroing the object before freeing it in idr_remove_all().

But we agree that simply removing the constructor and zeroing the object
at allocation time is simpler than relying upon slab constructor machinery
and might even be faster.

This problem was introduced by "idr: make idr_remove rcu-safe" (commit
cf481c20c476ad2c0febdace9ce23f5a4db19582), which was first released in
2.6.27.

There are no known codesites which trigger this bug in 2.6.27 or 2.6.28.
The post-2.6.28 firewire changes are the only known triggerer.

There might of course be not-yet-discovered triggerers in 2.6.27 and
2.6.28, and there might be out-of-tree triggerers which are added to those
kernel versions.  I'll let the -stable guys decide whether they want to
backport this fix.

Reported-by: David Moore &lt;dcm@acm.org&gt;
Cc: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Cc: Nadia Derbey &lt;Nadia.Derbey@bull.net&gt;
Cc: Paul E. McKenney &lt;paulmck@us.ibm.com&gt;
Cc: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Cc: Kristian Hgsberg &lt;krh@redhat.com&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>lib/idr.c: Fix bug introduced by RCU fix</title>
<updated>2008-12-18T17:13:36+00:00</updated>
<author>
<name>Manfred Spraul</name>
<email>manfred@colorfullife.com</email>
</author>
<published>2008-12-10T17:17:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b543708755a23b1de7ba140061b93bb17a5e22e4'/>
<id>b543708755a23b1de7ba140061b93bb17a5e22e4</id>
<content type='text'>
commit 711a49a07f84f914aac26a52143f6e7526571143 upstream.

The last patch to lib/idr.c caused a bug if idr_get_new_above() was
called on an empty idr.

Usually, nodes stay on the same layer.  New layers are added to the top
of the tree.

The exception is idr_get_new_above() on an empty tree: In this case, the
new root node is first added on layer 0, then moved upwards.  p-&gt;layer
was not updated.

As usual: You shall never rely on the source code comments, they will
only mislead you.

Signed-off-by: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 711a49a07f84f914aac26a52143f6e7526571143 upstream.

The last patch to lib/idr.c caused a bug if idr_get_new_above() was
called on an empty idr.

Usually, nodes stay on the same layer.  New layers are added to the top
of the tree.

The exception is idr_get_new_above() on an empty tree: In this case, the
new root node is first added on layer 0, then moved upwards.  p-&gt;layer
was not updated.

As usual: You shall never rely on the source code comments, they will
only mislead you.

Signed-off-by: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>lib/idr.c: fix rcu related race with idr_find</title>
<updated>2008-12-05T18:55:13+00:00</updated>
<author>
<name>Manfred Spraul</name>
<email>manfred@colorfullife.com</email>
</author>
<published>2008-12-01T21:14:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=228d6b8f4ca2c057e9c63559f72af111b4356bd3'/>
<id>228d6b8f4ca2c057e9c63559f72af111b4356bd3</id>
<content type='text'>
commit 6ff2d39b91aec3dcae951afa982059e3dd9b49dc upstream.

2nd part of the fixes needed for
http://bugzilla.kernel.org/show_bug.cgi?id=11796.

When the idr tree is either grown or shrunk, then the update to the number
of layers and the top pointer were not atomic.  This race caused crashes.

The attached patch fixes that by replicating the layers counter in each
layer, thus idr_find doesn't need idp-&gt;layers anymore.

Signed-off-by: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Cc: Clement Calmels &lt;cboulte@gmail.com&gt;
Cc: Nadia Derbey &lt;Nadia.Derbey@bull.net&gt;
Cc: Pierre Peiffer &lt;peifferp@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6ff2d39b91aec3dcae951afa982059e3dd9b49dc upstream.

2nd part of the fixes needed for
http://bugzilla.kernel.org/show_bug.cgi?id=11796.

When the idr tree is either grown or shrunk, then the update to the number
of layers and the top pointer were not atomic.  This race caused crashes.

The attached patch fixes that by replicating the layers counter in each
layer, thus idr_find doesn't need idp-&gt;layers anymore.

Signed-off-by: Manfred Spraul &lt;manfred@colorfullife.com&gt;
Cc: Clement Calmels &lt;cboulte@gmail.com&gt;
Cc: Nadia Derbey &lt;Nadia.Derbey@bull.net&gt;
Cc: Pierre Peiffer &lt;peifferp@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>lib/scatterlist.c: fix kunmap() argument in sg_miter_stop()</title>
<updated>2008-12-05T18:55:11+00:00</updated>
<author>
<name>Arjan van de Ven</name>
<email>arjan@infradead.org</email>
</author>
<published>2008-11-19T23:36:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3cd2da9078ffbb87afc4d5a15fa1cbb0891a724d'/>
<id>3cd2da9078ffbb87afc4d5a15fa1cbb0891a724d</id>
<content type='text'>
commit f652c521e0bec2e70cf123f47e80117a7e6ed139 upstream.

kunmap() takes as argument the struct page that orginally got kmap()'d,
however the sg_miter_stop() function passed it the kernel virtual address
instead, resulting in weird stuff.

Somehow I ended up fixing this bug by accident while looking for a bug in
the same area.

Reported-by: kerneloops.org
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f652c521e0bec2e70cf123f47e80117a7e6ed139 upstream.

kunmap() takes as argument the struct page that orginally got kmap()'d,
however the sg_miter_stop() function passed it the kernel virtual address
instead, resulting in weird stuff.

Somehow I ended up fixing this bug by accident while looking for a bug in
the same area.

Reported-by: kerneloops.org
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block</title>
<updated>2008-09-11T18:50:15+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-09-11T18:50:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a551b98d5f6fce5897d497abd8bfb262efb33d2a'/>
<id>a551b98d5f6fce5897d497abd8bfb262efb33d2a</id>
<content type='text'>
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  sg: disable interrupts inside sg_copy_buffer
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  sg: disable interrupts inside sg_copy_buffer
</pre>
</div>
</content>
</entry>
<entry>
<title>sg: disable interrupts inside sg_copy_buffer</title>
<updated>2008-09-11T16:35:39+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2008-09-11T16:35:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=50bed2e2862a8f3a4f7d683d0d27292e71ef18b9'/>
<id>50bed2e2862a8f3a4f7d683d0d27292e71ef18b9</id>
<content type='text'>
The callers of sg_copy_buffer must disable interrupts before calling
it (since it uses kmap_atomic). Some callers use it on
interrupt-disabled code but some need to take the trouble to disable
interrupts just for this. No wonder they forget about it and we hit a
bug like:

http://bugzilla.kernel.org/show_bug.cgi?id=11529

James said that it might be better to disable interrupts inside the
function rather than risk the callers getting it wrong.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The callers of sg_copy_buffer must disable interrupts before calling
it (since it uses kmap_atomic). Some callers use it on
interrupt-disabled code but some need to take the trouble to disable
interrupts just for this. No wonder they forget about it and we hit a
bug like:

http://bugzilla.kernel.org/show_bug.cgi?id=11529

James said that it might be better to disable interrupts inside the
function rather than risk the callers getting it wrong.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>swiotlb: fix back-off path when memory allocation fails</title>
<updated>2008-09-10T21:00:23+00:00</updated>
<author>
<name>Daniel J Blueman</name>
<email>daniel.blueman@gmail.com</email>
</author>
<published>2008-09-10T20:07:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=36223a399f639b13b7a454349565934e6d3e2db0'/>
<id>36223a399f639b13b7a454349565934e6d3e2db0</id>
<content type='text'>
This fixes a SWIOTLB oops

With SWIOTLB being enabled and straight-forward page allocation
failure [1], the swiotlb_alloc_coherent fall-back path hits an
issue [2], resulting in my webcam failing to work.

At the time of oops, RDI is clearly a pointer to a structure which
has arrived as NULL, leading to the typo in swiotlb_map_single's
callsite arguments.

Correctly passing the device structure [3] addresses the issue and
gets my webcam working again (the allocation failure still occuring).

 --- [1]

skype: page allocation failure. order:3, mode:0x1
Pid: 5895, comm: skype Not tainted 2.6.27-rc6-235c-debug #1

Call Trace:
 [&lt;ffffffff802b7cf0&gt;] __alloc_pages_internal+0x4a0/0x5d0
 [&lt;ffffffff802d5ddd&gt;] alloc_pages_current+0xad/0x110
 [&lt;ffffffff802b4ccd&gt;] __get_free_pages+0x1d/0x60
 [&lt;ffffffff8046cd39&gt;] swiotlb_alloc_coherent+0x49/0x180
 [&lt;ffffffff80212731&gt;] dma_alloc_coherent+0x281/0x310
 [&lt;ffffffff805621c0&gt;] hcd_buffer_alloc+0x50/0x90
 [&lt;ffffffff805547fd&gt;] usb_buffer_alloc+0x2d/0x40
 [&lt;ffffffffa0056763&gt;] uvc_alloc_urb_buffers+0x53/0xf0 [uvcvideo]
 [&lt;ffffffffa0056958&gt;] uvc_init_video+0x158/0x3e0 [uvcvideo]
 [&lt;ffffffffa0056c17&gt;] uvc_video_enable+0x37/0x80 [uvcvideo]
 [&lt;ffffffffa0055853&gt;] uvc_v4l2_do_ioctl+0x723/0x1260 [uvcvideo]
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffffa0032c9f&gt;] video_usercopy+0x19f/0x390 [videodev]
 [&lt;ffffffffa0055130&gt;] ? uvc_v4l2_do_ioctl+0x0/0x1260 [uvcvideo]
 [&lt;ffffffff8026d0ce&gt;] ? put_lock_stats+0xe/0x30
 [&lt;ffffffffa0054dad&gt;] uvc_v4l2_ioctl+0x4d/0x80 [uvcvideo]
 [&lt;ffffffffa0045083&gt;] native_ioctl+0x83/0x90 [compat_ioctl32]
 [&lt;ffffffffa004534e&gt;] v4l_compat_ioctl32+0x2be/0x1da4 [compat_ioctl32]
 [&lt;ffffffff806aad21&gt;] ? do_page_fault+0x3d1/0xae0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80270c59&gt;] ? trace_hardirqs_on_caller+0x149/0x1b0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80329afa&gt;] compat_sys_ioctl+0x8a/0x3c0
 [&lt;ffffffff806a700d&gt;] ? trace_hardirqs_off_thunk+0x3a/0x3c
 [&lt;ffffffff8022f816&gt;] sysenter_dispatch+0x7/0x2c
 [&lt;ffffffff806a6fce&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f

Mem-Info:
Node 0 DMA per-cpu:
CPU    0: hi:    0, btch:   1 usd:   0
CPU    1: hi:    0, btch:   1 usd:   0
Node 0 DMA32 per-cpu:
CPU    0: hi:  186, btch:  31 usd:   3
CPU    1: hi:  186, btch:  31 usd:   0
Node 0 Normal per-cpu:
CPU    0: hi:  186, btch:  31 usd:  23
CPU    1: hi:  186, btch:  31 usd: 179
Active:78545 inactive:48683 dirty:31 writeback:0 unstable:2
 free:830202 slab:17516 mapped:17473 pagetables:3496 bounce:0
Node 0 DMA free:36kB min:28kB low:32kB high:40kB active:0kB
inactive:0kB present:15156kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 3207 3956 3956
Node 0 DMA32 free:3197192kB min:6512kB low:8140kB high:9768kB
active:0kB inactive:0kB present:3284896kB pages_scanned:0
all_unreclaimable? no
lowmem_reserve[]: 0 0 748 748
Node 0 Normal free:123580kB min:1516kB low:1892kB high:2272kB
active:314180kB inactive:194732kB present:766464kB pages_scanned:0
all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 0 DMA: 1*4kB 0*8kB 0*16kB 1*32kB 0*64kB 0*128kB 0*256kB 0*512kB
0*1024kB 0*2048kB 0*4096kB = 36kB
Node 0 DMA32: 4*4kB 3*8kB 2*16kB 3*32kB 4*64kB 5*128kB 3*256kB 5*512kB
4*1024kB 5*2048kB 776*4096kB = 3197224kB
Node 0 Normal: 14*4kB 14*8kB 8*16kB 6*32kB 1*64kB 3*128kB 3*256kB
2*512kB 4*1024kB 1*2048kB 28*4096kB = 123560kB
64847 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 502752kB
Total swap = 502752kB
1048576 pages RAM
52120 pages reserved
71967 pages shared
143004 pages non-shared

 --- [2]

BUG: unable to handle kernel NULL pointer dereference at 00000000000002c8
IP: [&lt;ffffffff8046c84c&gt;] map_single+0x1c/0x280
PGD 10e54e067 PUD 10e595067 PMD 0
Oops: 0000 [1] PREEMPT SMP DEBUG_PAGEALLOC
CPU 0
Modules linked in: kvm_intel kvm microcode uvcvideo compat_ioctl32
videodev v4l1_compat shpchp pci_hotplug
Pid: 5895, comm: skype Not tainted 2.6.27-rc6-235c-debug #1
RIP: 0010:[&lt;ffffffff8046c84c&gt;]  [&lt;ffffffff8046c84c&gt;] map_single+0x1c/0x280
RSP: 0018:ffff88010e78d988  EFLAGS: 00210296
RAX: 0000780000000000 RBX: 0000000000000000 RCX: 0000000000000002
RDX: 0000000000005000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88010e78d9e8 R08: 0000000000000000 R09: 0000000000000001
R10: ffff88010e78d698 R11: 0000000000000001 R12: 0000000000000002
R13: 0000000000000000 R14: 0000000000005000 R15: ffff88012f1c9968
FS:  0000000000000000(0000) GS:ffffffff80a6cdc0(0063) knlGS:00000000f6355b90
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000000002c8 CR3: 000000010e57d000 CR4: 00000000000026e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process skype (pid: 5895, threadinfo ffff88010e78c000, task ffff88012b9cc460)
Stack:  0000000200000000 0000000000005000 0000000000000000 0000000000000000
 00000000000017b8 0000000000000000 ffff88010e78d9c8 0000000000000000
 0000000000000002 0000000000000000 0000000000005000 ffff88012f1c9968
Call Trace:
 [&lt;ffffffff8046cbb0&gt;] swiotlb_map_single_attrs+0x60/0xf0
 [&lt;ffffffff8046cc4c&gt;] swiotlb_map_single+0xc/0x10
 [&lt;ffffffff8046cdee&gt;] swiotlb_alloc_coherent+0xfe/0x180
 [&lt;ffffffff80212731&gt;] dma_alloc_coherent+0x281/0x310
 [&lt;ffffffff805621c0&gt;] hcd_buffer_alloc+0x50/0x90
 [&lt;ffffffff805547fd&gt;] usb_buffer_alloc+0x2d/0x40
 [&lt;ffffffffa0056763&gt;] uvc_alloc_urb_buffers+0x53/0xf0 [uvcvideo]
 [&lt;ffffffffa0056958&gt;] uvc_init_video+0x158/0x3e0 [uvcvideo]
 [&lt;ffffffffa0056c17&gt;] uvc_video_enable+0x37/0x80 [uvcvideo]
 [&lt;ffffffffa0055853&gt;] uvc_v4l2_do_ioctl+0x723/0x1260 [uvcvideo]
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffffa0032c9f&gt;] video_usercopy+0x19f/0x390 [videodev]
 [&lt;ffffffffa0055130&gt;] ? uvc_v4l2_do_ioctl+0x0/0x1260 [uvcvideo]
 [&lt;ffffffff8026d0ce&gt;] ? put_lock_stats+0xe/0x30
 [&lt;ffffffffa0054dad&gt;] uvc_v4l2_ioctl+0x4d/0x80 [uvcvideo]
 [&lt;ffffffffa0045083&gt;] native_ioctl+0x83/0x90 [compat_ioctl32]
 [&lt;ffffffffa004534e&gt;] v4l_compat_ioctl32+0x2be/0x1da4 [compat_ioctl32]
 [&lt;ffffffff806aad21&gt;] ? do_page_fault+0x3d1/0xae0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80270c59&gt;] ? trace_hardirqs_on_caller+0x149/0x1b0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80329afa&gt;] compat_sys_ioctl+0x8a/0x3c0
 [&lt;ffffffff806a700d&gt;] ? trace_hardirqs_off_thunk+0x3a/0x3c
 [&lt;ffffffff8022f816&gt;] sysenter_dispatch+0x7/0x2c
 [&lt;ffffffff806a6fce&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f

Code: 45 31 c0 48 89 e5 e8 a4 ff ff ff c9 c3 66 90 55 48 89 e5 41 57
41 56 41 55 41 54 53 48 83 ec 38 48 89 75 b0 48 89 55 a8 89 4d a4 &lt;48&gt;
8b 87 c8 02 00 00 48 85 c0 0f 84 1c 02 00 00 48 8b 58 08 48
RIP  [&lt;ffffffff8046c84c&gt;] map_single+0x1c/0x280
 RSP &lt;ffff88010e78d988&gt;
CR2: 00000000000002c8
---[ end trace 5d15baeeb7025a0e ]---

 --- [3]

ffffffff8046c830 &lt;map_single&gt;:
map_single():
/store/kernel/linux/lib/swiotlb.c:291
ffffffff8046c830:       55                      push   %rbp
ffffffff8046c831:       48 89 e5                mov    %rsp,%rbp
ffffffff8046c834:       41 57                   push   %r15
ffffffff8046c836:       41 56                   push   %r14
ffffffff8046c838:       41 55                   push   %r13
ffffffff8046c83a:       41 54                   push   %r12
ffffffff8046c83c:       53                      push   %rbx
ffffffff8046c83d:       48 83 ec 38             sub    $0x38,%rsp
ffffffff8046c841:       48 89 75 b0             mov    %rsi,-0x50(%rbp)
ffffffff8046c845:       48 89 55 a8             mov    %rdx,-0x58(%rbp)
ffffffff8046c849:       89 4d a4                mov    %ecx,-0x5c(%rbp)
dma_get_seg_boundary():
/store/kernel/linux/include/linux/dma-mapping.h:80
ffffffff8046c84c:       48 8b 87 c8 02 00 00    mov    0x2c8(%rdi),%rax &lt;----

 --- [4]

Signed-off-by: Daniel J Blueman &lt;daniel.blueman@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a SWIOTLB oops

With SWIOTLB being enabled and straight-forward page allocation
failure [1], the swiotlb_alloc_coherent fall-back path hits an
issue [2], resulting in my webcam failing to work.

At the time of oops, RDI is clearly a pointer to a structure which
has arrived as NULL, leading to the typo in swiotlb_map_single's
callsite arguments.

Correctly passing the device structure [3] addresses the issue and
gets my webcam working again (the allocation failure still occuring).

 --- [1]

skype: page allocation failure. order:3, mode:0x1
Pid: 5895, comm: skype Not tainted 2.6.27-rc6-235c-debug #1

Call Trace:
 [&lt;ffffffff802b7cf0&gt;] __alloc_pages_internal+0x4a0/0x5d0
 [&lt;ffffffff802d5ddd&gt;] alloc_pages_current+0xad/0x110
 [&lt;ffffffff802b4ccd&gt;] __get_free_pages+0x1d/0x60
 [&lt;ffffffff8046cd39&gt;] swiotlb_alloc_coherent+0x49/0x180
 [&lt;ffffffff80212731&gt;] dma_alloc_coherent+0x281/0x310
 [&lt;ffffffff805621c0&gt;] hcd_buffer_alloc+0x50/0x90
 [&lt;ffffffff805547fd&gt;] usb_buffer_alloc+0x2d/0x40
 [&lt;ffffffffa0056763&gt;] uvc_alloc_urb_buffers+0x53/0xf0 [uvcvideo]
 [&lt;ffffffffa0056958&gt;] uvc_init_video+0x158/0x3e0 [uvcvideo]
 [&lt;ffffffffa0056c17&gt;] uvc_video_enable+0x37/0x80 [uvcvideo]
 [&lt;ffffffffa0055853&gt;] uvc_v4l2_do_ioctl+0x723/0x1260 [uvcvideo]
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffffa0032c9f&gt;] video_usercopy+0x19f/0x390 [videodev]
 [&lt;ffffffffa0055130&gt;] ? uvc_v4l2_do_ioctl+0x0/0x1260 [uvcvideo]
 [&lt;ffffffff8026d0ce&gt;] ? put_lock_stats+0xe/0x30
 [&lt;ffffffffa0054dad&gt;] uvc_v4l2_ioctl+0x4d/0x80 [uvcvideo]
 [&lt;ffffffffa0045083&gt;] native_ioctl+0x83/0x90 [compat_ioctl32]
 [&lt;ffffffffa004534e&gt;] v4l_compat_ioctl32+0x2be/0x1da4 [compat_ioctl32]
 [&lt;ffffffff806aad21&gt;] ? do_page_fault+0x3d1/0xae0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80270c59&gt;] ? trace_hardirqs_on_caller+0x149/0x1b0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80329afa&gt;] compat_sys_ioctl+0x8a/0x3c0
 [&lt;ffffffff806a700d&gt;] ? trace_hardirqs_off_thunk+0x3a/0x3c
 [&lt;ffffffff8022f816&gt;] sysenter_dispatch+0x7/0x2c
 [&lt;ffffffff806a6fce&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f

Mem-Info:
Node 0 DMA per-cpu:
CPU    0: hi:    0, btch:   1 usd:   0
CPU    1: hi:    0, btch:   1 usd:   0
Node 0 DMA32 per-cpu:
CPU    0: hi:  186, btch:  31 usd:   3
CPU    1: hi:  186, btch:  31 usd:   0
Node 0 Normal per-cpu:
CPU    0: hi:  186, btch:  31 usd:  23
CPU    1: hi:  186, btch:  31 usd: 179
Active:78545 inactive:48683 dirty:31 writeback:0 unstable:2
 free:830202 slab:17516 mapped:17473 pagetables:3496 bounce:0
Node 0 DMA free:36kB min:28kB low:32kB high:40kB active:0kB
inactive:0kB present:15156kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 3207 3956 3956
Node 0 DMA32 free:3197192kB min:6512kB low:8140kB high:9768kB
active:0kB inactive:0kB present:3284896kB pages_scanned:0
all_unreclaimable? no
lowmem_reserve[]: 0 0 748 748
Node 0 Normal free:123580kB min:1516kB low:1892kB high:2272kB
active:314180kB inactive:194732kB present:766464kB pages_scanned:0
all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Node 0 DMA: 1*4kB 0*8kB 0*16kB 1*32kB 0*64kB 0*128kB 0*256kB 0*512kB
0*1024kB 0*2048kB 0*4096kB = 36kB
Node 0 DMA32: 4*4kB 3*8kB 2*16kB 3*32kB 4*64kB 5*128kB 3*256kB 5*512kB
4*1024kB 5*2048kB 776*4096kB = 3197224kB
Node 0 Normal: 14*4kB 14*8kB 8*16kB 6*32kB 1*64kB 3*128kB 3*256kB
2*512kB 4*1024kB 1*2048kB 28*4096kB = 123560kB
64847 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 502752kB
Total swap = 502752kB
1048576 pages RAM
52120 pages reserved
71967 pages shared
143004 pages non-shared

 --- [2]

BUG: unable to handle kernel NULL pointer dereference at 00000000000002c8
IP: [&lt;ffffffff8046c84c&gt;] map_single+0x1c/0x280
PGD 10e54e067 PUD 10e595067 PMD 0
Oops: 0000 [1] PREEMPT SMP DEBUG_PAGEALLOC
CPU 0
Modules linked in: kvm_intel kvm microcode uvcvideo compat_ioctl32
videodev v4l1_compat shpchp pci_hotplug
Pid: 5895, comm: skype Not tainted 2.6.27-rc6-235c-debug #1
RIP: 0010:[&lt;ffffffff8046c84c&gt;]  [&lt;ffffffff8046c84c&gt;] map_single+0x1c/0x280
RSP: 0018:ffff88010e78d988  EFLAGS: 00210296
RAX: 0000780000000000 RBX: 0000000000000000 RCX: 0000000000000002
RDX: 0000000000005000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88010e78d9e8 R08: 0000000000000000 R09: 0000000000000001
R10: ffff88010e78d698 R11: 0000000000000001 R12: 0000000000000002
R13: 0000000000000000 R14: 0000000000005000 R15: ffff88012f1c9968
FS:  0000000000000000(0000) GS:ffffffff80a6cdc0(0063) knlGS:00000000f6355b90
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000000002c8 CR3: 000000010e57d000 CR4: 00000000000026e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process skype (pid: 5895, threadinfo ffff88010e78c000, task ffff88012b9cc460)
Stack:  0000000200000000 0000000000005000 0000000000000000 0000000000000000
 00000000000017b8 0000000000000000 ffff88010e78d9c8 0000000000000000
 0000000000000002 0000000000000000 0000000000005000 ffff88012f1c9968
Call Trace:
 [&lt;ffffffff8046cbb0&gt;] swiotlb_map_single_attrs+0x60/0xf0
 [&lt;ffffffff8046cc4c&gt;] swiotlb_map_single+0xc/0x10
 [&lt;ffffffff8046cdee&gt;] swiotlb_alloc_coherent+0xfe/0x180
 [&lt;ffffffff80212731&gt;] dma_alloc_coherent+0x281/0x310
 [&lt;ffffffff805621c0&gt;] hcd_buffer_alloc+0x50/0x90
 [&lt;ffffffff805547fd&gt;] usb_buffer_alloc+0x2d/0x40
 [&lt;ffffffffa0056763&gt;] uvc_alloc_urb_buffers+0x53/0xf0 [uvcvideo]
 [&lt;ffffffffa0056958&gt;] uvc_init_video+0x158/0x3e0 [uvcvideo]
 [&lt;ffffffffa0056c17&gt;] uvc_video_enable+0x37/0x80 [uvcvideo]
 [&lt;ffffffffa0055853&gt;] uvc_v4l2_do_ioctl+0x723/0x1260 [uvcvideo]
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffff8026dd61&gt;] ? trace_hardirqs_off_caller+0x21/0xc0
 [&lt;ffffffffa0032c9f&gt;] video_usercopy+0x19f/0x390 [videodev]
 [&lt;ffffffffa0055130&gt;] ? uvc_v4l2_do_ioctl+0x0/0x1260 [uvcvideo]
 [&lt;ffffffff8026d0ce&gt;] ? put_lock_stats+0xe/0x30
 [&lt;ffffffffa0054dad&gt;] uvc_v4l2_ioctl+0x4d/0x80 [uvcvideo]
 [&lt;ffffffffa0045083&gt;] native_ioctl+0x83/0x90 [compat_ioctl32]
 [&lt;ffffffffa004534e&gt;] v4l_compat_ioctl32+0x2be/0x1da4 [compat_ioctl32]
 [&lt;ffffffff806aad21&gt;] ? do_page_fault+0x3d1/0xae0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80270c59&gt;] ? trace_hardirqs_on_caller+0x149/0x1b0
 [&lt;ffffffff80270ccd&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff80329afa&gt;] compat_sys_ioctl+0x8a/0x3c0
 [&lt;ffffffff806a700d&gt;] ? trace_hardirqs_off_thunk+0x3a/0x3c
 [&lt;ffffffff8022f816&gt;] sysenter_dispatch+0x7/0x2c
 [&lt;ffffffff806a6fce&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f

Code: 45 31 c0 48 89 e5 e8 a4 ff ff ff c9 c3 66 90 55 48 89 e5 41 57
41 56 41 55 41 54 53 48 83 ec 38 48 89 75 b0 48 89 55 a8 89 4d a4 &lt;48&gt;
8b 87 c8 02 00 00 48 85 c0 0f 84 1c 02 00 00 48 8b 58 08 48
RIP  [&lt;ffffffff8046c84c&gt;] map_single+0x1c/0x280
 RSP &lt;ffff88010e78d988&gt;
CR2: 00000000000002c8
---[ end trace 5d15baeeb7025a0e ]---

 --- [3]

ffffffff8046c830 &lt;map_single&gt;:
map_single():
/store/kernel/linux/lib/swiotlb.c:291
ffffffff8046c830:       55                      push   %rbp
ffffffff8046c831:       48 89 e5                mov    %rsp,%rbp
ffffffff8046c834:       41 57                   push   %r15
ffffffff8046c836:       41 56                   push   %r14
ffffffff8046c838:       41 55                   push   %r13
ffffffff8046c83a:       41 54                   push   %r12
ffffffff8046c83c:       53                      push   %rbx
ffffffff8046c83d:       48 83 ec 38             sub    $0x38,%rsp
ffffffff8046c841:       48 89 75 b0             mov    %rsi,-0x50(%rbp)
ffffffff8046c845:       48 89 55 a8             mov    %rdx,-0x58(%rbp)
ffffffff8046c849:       89 4d a4                mov    %ecx,-0x5c(%rbp)
dma_get_seg_boundary():
/store/kernel/linux/include/linux/dma-mapping.h:80
ffffffff8046c84c:       48 8b 87 c8 02 00 00    mov    0x2c8(%rdi),%rax &lt;----

 --- [4]

Signed-off-by: Daniel J Blueman &lt;daniel.blueman@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Correct printk %pF to work on all architectures</title>
<updated>2008-09-09T18:51:15+00:00</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2008-09-04T01:43:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=deac93df26b20cf8438339b5935b5f5643bc30c9'/>
<id>deac93df26b20cf8438339b5935b5f5643bc30c9</id>
<content type='text'>
It was introduced by "vsprintf: add support for '%pS' and '%pF' pointer
formats" in commit 0fe1ef24f7bd0020f29ffe287dfdb9ead33ca0b2.  However,
the current way its coded doesn't work on parisc64.  For two reasons: 1)
parisc isn't in the #ifdef and 2) parisc has a different format for
function descriptors

Make dereference_function_descriptor() more accommodating by allowing
architecture overrides.  I put the three overrides (for parisc64, ppc64
and ia64) in arch/kernel/module.c because that's where the kernel
internal linker which knows how to deal with function descriptors sits.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
Acked-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was introduced by "vsprintf: add support for '%pS' and '%pF' pointer
formats" in commit 0fe1ef24f7bd0020f29ffe287dfdb9ead33ca0b2.  However,
the current way its coded doesn't work on parisc64.  For two reasons: 1)
parisc isn't in the #ifdef and 2) parisc has a different format for
function descriptors

Make dereference_function_descriptor() more accommodating by allowing
architecture overrides.  I put the three overrides (for parisc64, ppc64
and ia64) in arch/kernel/module.c because that's where the kernel
internal linker which knows how to deal with function descriptors sits.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
Acked-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
