<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/include/net, branch v3.3.5</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>Bluetooth: hci_core: fix NULL-pointer dereference at unregister</title>
<updated>2012-04-22T22:38:55+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>jhovold@gmail.com</email>
</author>
<published>2012-03-15T13:48:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5993a671e7146b0ab49b901588be0cb128b26431'/>
<id>5993a671e7146b0ab49b901588be0cb128b26431</id>
<content type='text'>
commit 94324962066231a938564bebad0f941cd2d06bb2 upstream.

Make sure hci_dev_open returns immediately if hci_dev_unregister has
been called.

This fixes a race between hci_dev_open and hci_dev_unregister which can
lead to a NULL-pointer dereference.

Bug is 100% reproducible using hciattach and a disconnected serial port:

0. # hciattach -n /dev/ttyO1 any noflow

1. hci_dev_open called from hci_power_on grabs req lock
2. hci_init_req executes but device fails to initialise (times out
   eventually)
3. hci_dev_open is called from hci_sock_ioctl and sleeps on req lock
4. hci_uart_tty_close calls hci_dev_unregister and sleeps on req lock in
   hci_dev_do_close
5. hci_dev_open (1) releases req lock
6. hci_dev_do_close grabs req lock and returns as device is not up
7. hci_dev_unregister sleeps in destroy_workqueue
8. hci_dev_open (3) grabs req lock, calls hci_init_req and eventually sleeps
9. hci_dev_unregister finishes, while hci_dev_open is still running...

[   79.627136] INFO: trying to register non-static key.
[   79.632354] the code is fine but needs lockdep annotation.
[   79.638122] turning off the locking correctness validator.
[   79.643920] [&lt;c00188bc&gt;] (unwind_backtrace+0x0/0xf8) from [&lt;c00729c4&gt;] (__lock_acquire+0x1590/0x1ab0)
[   79.653594] [&lt;c00729c4&gt;] (__lock_acquire+0x1590/0x1ab0) from [&lt;c00733f8&gt;] (lock_acquire+0x9c/0x128)
[   79.663085] [&lt;c00733f8&gt;] (lock_acquire+0x9c/0x128) from [&lt;c0040a88&gt;] (run_timer_softirq+0x150/0x3ac)
[   79.672668] [&lt;c0040a88&gt;] (run_timer_softirq+0x150/0x3ac) from [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c)
[   79.682281] [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c) from [&lt;c003a924&gt;] (irq_exit+0x8c/0x94)
[   79.690856] [&lt;c003a924&gt;] (irq_exit+0x8c/0x94) from [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84)
[   79.699157] [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84) from [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c)
[   79.708648] [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c) from [&lt;c037499c&gt;] (__irq_usr+0x3c/0x60)
[   79.718048] Exception stack(0xcf281fb0 to 0xcf281ff8)
[   79.723358] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
[   79.731933] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
[   79.740509] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
[   79.747497] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   79.756011] pgd = cf3b4000
[   79.758850] [00000000] *pgd=8f0c7831, *pte=00000000, *ppte=00000000
[   79.765502] Internal error: Oops: 80000007 [#1]
[   79.770294] Modules linked in:
[   79.773529] CPU: 0    Tainted: G        W     (3.3.0-rc6-00002-gb5d5c87 #421)
[   79.781066] PC is at 0x0
[   79.783721] LR is at run_timer_softirq+0x16c/0x3ac
[   79.788787] pc : [&lt;00000000&gt;]    lr : [&lt;c0040aa4&gt;]    psr: 60000113
[   79.788787] sp : cf281ee0  ip : 00000000  fp : cf280000
[   79.800903] r10: 00000004  r9 : 00000100  r8 : b6f234d0
[   79.806427] r7 : c0519c28  r6 : cf093488  r5 : c0561a00  r4 : 00000000
[   79.813323] r3 : 00000000  r2 : c054eee0  r1 : 00000001  r0 : 00000000
[   79.820190] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   79.827728] Control: 10c5387d  Table: 8f3b4019  DAC: 00000015
[   79.833801] Process gpsd (pid: 1265, stack limit = 0xcf2802e8)
[   79.839965] Stack: (0xcf281ee0 to 0xcf282000)
[   79.844573] 1ee0: 00000002 00000000 c0040a24 00000000 00000002 cf281f08 00200200 00000000
[   79.853210] 1f00: 00000000 cf281f18 cf281f08 00000000 00000000 00000000 cf281f18 cf281f18
[   79.861816] 1f20: 00000000 00000001 c056184c 00000000 00000001 b6f234d0 c0561848 00000004
[   79.870452] 1f40: cf280000 c003a3b8 c051e79c 00000001 00000000 00000100 3fa9e7b8 0000000a
[   79.879089] 1f60: 00000025 cf280000 00000025 00000000 00000000 b6f234d0 00000000 00000004
[   79.887756] 1f80: 00000000 c003a924 c053ad38 c0013a50 fa200000 cf281fb0 ffffffff c0008530
[   79.896362] 1fa0: 0001e6a0 0000aab8 80000010 c037499c 0001e6a0 be8dab00 0001e698 00036698
[   79.904998] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
[   79.913665] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff 00fbf700 04ffff00
[   79.922302] [&lt;c0040aa4&gt;] (run_timer_softirq+0x16c/0x3ac) from [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c)
[   79.931945] [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c) from [&lt;c003a924&gt;] (irq_exit+0x8c/0x94)
[   79.940582] [&lt;c003a924&gt;] (irq_exit+0x8c/0x94) from [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84)
[   79.948913] [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84) from [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c)
[   79.958404] [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c) from [&lt;c037499c&gt;] (__irq_usr+0x3c/0x60)
[   79.967773] Exception stack(0xcf281fb0 to 0xcf281ff8)
[   79.973083] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
[   79.981658] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
[   79.990234] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
[   79.997161] Code: bad PC value
[   80.000396] ---[ end trace 6f6739840475f9ee ]---
[   80.005279] Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Johan Hovold &lt;jhovold@gmail.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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

Make sure hci_dev_open returns immediately if hci_dev_unregister has
been called.

This fixes a race between hci_dev_open and hci_dev_unregister which can
lead to a NULL-pointer dereference.

Bug is 100% reproducible using hciattach and a disconnected serial port:

0. # hciattach -n /dev/ttyO1 any noflow

1. hci_dev_open called from hci_power_on grabs req lock
2. hci_init_req executes but device fails to initialise (times out
   eventually)
3. hci_dev_open is called from hci_sock_ioctl and sleeps on req lock
4. hci_uart_tty_close calls hci_dev_unregister and sleeps on req lock in
   hci_dev_do_close
5. hci_dev_open (1) releases req lock
6. hci_dev_do_close grabs req lock and returns as device is not up
7. hci_dev_unregister sleeps in destroy_workqueue
8. hci_dev_open (3) grabs req lock, calls hci_init_req and eventually sleeps
9. hci_dev_unregister finishes, while hci_dev_open is still running...

[   79.627136] INFO: trying to register non-static key.
[   79.632354] the code is fine but needs lockdep annotation.
[   79.638122] turning off the locking correctness validator.
[   79.643920] [&lt;c00188bc&gt;] (unwind_backtrace+0x0/0xf8) from [&lt;c00729c4&gt;] (__lock_acquire+0x1590/0x1ab0)
[   79.653594] [&lt;c00729c4&gt;] (__lock_acquire+0x1590/0x1ab0) from [&lt;c00733f8&gt;] (lock_acquire+0x9c/0x128)
[   79.663085] [&lt;c00733f8&gt;] (lock_acquire+0x9c/0x128) from [&lt;c0040a88&gt;] (run_timer_softirq+0x150/0x3ac)
[   79.672668] [&lt;c0040a88&gt;] (run_timer_softirq+0x150/0x3ac) from [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c)
[   79.682281] [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c) from [&lt;c003a924&gt;] (irq_exit+0x8c/0x94)
[   79.690856] [&lt;c003a924&gt;] (irq_exit+0x8c/0x94) from [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84)
[   79.699157] [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84) from [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c)
[   79.708648] [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c) from [&lt;c037499c&gt;] (__irq_usr+0x3c/0x60)
[   79.718048] Exception stack(0xcf281fb0 to 0xcf281ff8)
[   79.723358] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
[   79.731933] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
[   79.740509] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
[   79.747497] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   79.756011] pgd = cf3b4000
[   79.758850] [00000000] *pgd=8f0c7831, *pte=00000000, *ppte=00000000
[   79.765502] Internal error: Oops: 80000007 [#1]
[   79.770294] Modules linked in:
[   79.773529] CPU: 0    Tainted: G        W     (3.3.0-rc6-00002-gb5d5c87 #421)
[   79.781066] PC is at 0x0
[   79.783721] LR is at run_timer_softirq+0x16c/0x3ac
[   79.788787] pc : [&lt;00000000&gt;]    lr : [&lt;c0040aa4&gt;]    psr: 60000113
[   79.788787] sp : cf281ee0  ip : 00000000  fp : cf280000
[   79.800903] r10: 00000004  r9 : 00000100  r8 : b6f234d0
[   79.806427] r7 : c0519c28  r6 : cf093488  r5 : c0561a00  r4 : 00000000
[   79.813323] r3 : 00000000  r2 : c054eee0  r1 : 00000001  r0 : 00000000
[   79.820190] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   79.827728] Control: 10c5387d  Table: 8f3b4019  DAC: 00000015
[   79.833801] Process gpsd (pid: 1265, stack limit = 0xcf2802e8)
[   79.839965] Stack: (0xcf281ee0 to 0xcf282000)
[   79.844573] 1ee0: 00000002 00000000 c0040a24 00000000 00000002 cf281f08 00200200 00000000
[   79.853210] 1f00: 00000000 cf281f18 cf281f08 00000000 00000000 00000000 cf281f18 cf281f18
[   79.861816] 1f20: 00000000 00000001 c056184c 00000000 00000001 b6f234d0 c0561848 00000004
[   79.870452] 1f40: cf280000 c003a3b8 c051e79c 00000001 00000000 00000100 3fa9e7b8 0000000a
[   79.879089] 1f60: 00000025 cf280000 00000025 00000000 00000000 b6f234d0 00000000 00000004
[   79.887756] 1f80: 00000000 c003a924 c053ad38 c0013a50 fa200000 cf281fb0 ffffffff c0008530
[   79.896362] 1fa0: 0001e6a0 0000aab8 80000010 c037499c 0001e6a0 be8dab00 0001e698 00036698
[   79.904998] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
[   79.913665] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff 00fbf700 04ffff00
[   79.922302] [&lt;c0040aa4&gt;] (run_timer_softirq+0x16c/0x3ac) from [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c)
[   79.931945] [&lt;c003a3b8&gt;] (__do_softirq+0xd4/0x22c) from [&lt;c003a924&gt;] (irq_exit+0x8c/0x94)
[   79.940582] [&lt;c003a924&gt;] (irq_exit+0x8c/0x94) from [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84)
[   79.948913] [&lt;c0013a50&gt;] (handle_IRQ+0x34/0x84) from [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c)
[   79.958404] [&lt;c0008530&gt;] (omap3_intc_handle_irq+0x48/0x4c) from [&lt;c037499c&gt;] (__irq_usr+0x3c/0x60)
[   79.967773] Exception stack(0xcf281fb0 to 0xcf281ff8)
[   79.973083] 1fa0:                                     0001e6a0 be8dab00 0001e698 00036698
[   79.981658] 1fc0: 0002df98 0002df38 0000001f 00000000 b6f234d0 00000000 00000004 00000000
[   79.990234] 1fe0: 0001e6f8 be8d6aa0 be8dac50 0000aab8 80000010 ffffffff
[   79.997161] Code: bad PC value
[   80.000396] ---[ end trace 6f6739840475f9ee ]---
[   80.005279] Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Johan Hovold &lt;jhovold@gmail.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>route: Remove redirect_genid</title>
<updated>2012-03-08T08:30:32+00:00</updated>
<author>
<name>Steffen Klassert</name>
<email>steffen.klassert@secunet.com</email>
</author>
<published>2012-03-06T21:21:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ac3f48de09d8f4b73397047e413fadff7f65cfa7'/>
<id>ac3f48de09d8f4b73397047e413fadff7f65cfa7</id>
<content type='text'>
As we invalidate the inetpeer tree along with the routing cache now,
we don't need a genid to reset the redirect handling when the routing
cache is flushed.

Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As we invalidate the inetpeer tree along with the routing cache now,
we don't need a genid to reset the redirect handling when the routing
cache is flushed.

Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>inetpeer: Invalidate the inetpeer tree along with the routing cache</title>
<updated>2012-03-08T08:30:24+00:00</updated>
<author>
<name>Steffen Klassert</name>
<email>steffen.klassert@secunet.com</email>
</author>
<published>2012-03-06T21:20:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5faa5df1fa2024bd750089ff21dcc4191798263d'/>
<id>5faa5df1fa2024bd750089ff21dcc4191798263d</id>
<content type='text'>
We initialize the routing metrics with the values cached on the
inetpeer in rt_init_metrics(). So if we have the metrics cached on the
inetpeer, we ignore the user configured fib_metrics.

To fix this issue, we replace the old tree with a fresh initialized
inet_peer_base. The old tree is removed later with a delayed work queue.

Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We initialize the routing metrics with the values cached on the
inetpeer in rt_init_metrics(). So if we have the metrics cached on the
inetpeer, we ignore the user configured fib_metrics.

To fix this issue, we replace the old tree with a fresh initialized
inet_peer_base. The old tree is removed later with a delayed work queue.

Signed-off-by: Steffen Klassert &lt;steffen.klassert@secunet.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcp: fix comment for tp-&gt;highest_sack</title>
<updated>2012-02-28T20:06:33+00:00</updated>
<author>
<name>Neal Cardwell</name>
<email>ncardwell@google.com</email>
</author>
<published>2012-02-27T22:52:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ecb971923614775a118bc05ad16b2bde450cac7d'/>
<id>ecb971923614775a118bc05ad16b2bde450cac7d</id>
<content type='text'>
There was an off-by-one error in the comments describing the
highest_sack field in struct tcp_sock. The comments previously claimed
that it was the "start sequence of the highest skb with SACKed
bit". This commit fixes the comments to note that it is the "start
sequence of the skb just *after* the highest skb with SACKed bit".

Signed-off-by: Neal Cardwell &lt;ncardwell@google.com&gt;
Acked-by: Ilpo Järvinen &lt;ilpo.jarvinen@helsinki.fi&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was an off-by-one error in the comments describing the
highest_sack field in struct tcp_sock. The comments previously claimed
that it was the "start sequence of the highest skb with SACKed
bit". This commit fixes the comments to note that it is the "start
sequence of the skb just *after* the highest skb with SACKed bit".

Signed-off-by: Neal Cardwell &lt;ncardwell@google.com&gt;
Acked-by: Ilpo Järvinen &lt;ilpo.jarvinen@helsinki.fi&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)</title>
<updated>2012-02-24T11:24:15+00:00</updated>
<author>
<name>Jozsef Kadlecsik</name>
<email>kadlec@blackhole.kfki.hu</email>
</author>
<published>2012-02-24T10:45:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7d367e06688dc7a2cc98c2ace04e1296e1d987e2'/>
<id>7d367e06688dc7a2cc98c2ace04e1296e1d987e2</id>
<content type='text'>
Marcell Zambo and Janos Farago noticed and reported that when
new conntrack entries are added via netlink and the conntrack table
gets full, soft lockup happens. This is because the nf_conntrack_lock
is held while nf_conntrack_alloc is called, which is in turn wants
to lock nf_conntrack_lock while evicting entries from the full table.

The patch fixes the soft lockup with limiting the holding of the
nf_conntrack_lock to the minimum, where it's absolutely required.
It required to extend (and thus change) nf_conntrack_hash_insert
so that it makes sure conntrack and ctnetlink do not add the same entry
twice to the conntrack table.

Signed-off-by: Jozsef Kadlecsik &lt;kadlec@blackhole.kfki.hu&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Marcell Zambo and Janos Farago noticed and reported that when
new conntrack entries are added via netlink and the conntrack table
gets full, soft lockup happens. This is because the nf_conntrack_lock
is held while nf_conntrack_alloc is called, which is in turn wants
to lock nf_conntrack_lock while evicting entries from the full table.

The patch fixes the soft lockup with limiting the holding of the
nf_conntrack_lock to the minimum, where it's absolutely required.
It required to extend (and thus change) nf_conntrack_hash_insert
so that it makes sure conntrack and ctnetlink do not add the same entry
twice to the conntrack table.

Signed-off-by: Jozsef Kadlecsik &lt;kadlec@blackhole.kfki.hu&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtnetlink: Fix problem with buffer allocation</title>
<updated>2012-02-21T21:56:45+00:00</updated>
<author>
<name>Greg Rose</name>
<email>gregory.v.rose@intel.com</email>
</author>
<published>2012-02-21T21:54:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=115c9b81928360d769a76c632bae62d15206a94a'/>
<id>115c9b81928360d769a76c632bae62d15206a94a</id>
<content type='text'>
Implement a new netlink attribute type IFLA_EXT_MASK.  The mask
is a 32 bit value that can be used to indicate to the kernel that
certain extended ifinfo values are requested by the user application.
At this time the only mask value defined is RTEXT_FILTER_VF to
indicate that the user wants the ifinfo dump to send information
about the VFs belonging to the interface.

This patch fixes a bug in which certain applications do not have
large enough buffers to accommodate the extra information returned
by the kernel with large numbers of SR-IOV virtual functions.
Those applications will not send the new netlink attribute with
the interface info dump request netlink messages so they will
not get unexpectedly large request buffers returned by the kernel.

Modifies the rtnl_calcit function to traverse the list of net
devices and compute the minimum buffer size that can hold the
info dumps of all matching devices based upon the filter passed
in via the new netlink attribute filter mask.  If no filter
mask is sent then the buffer allocation defaults to NLMSG_GOODSIZE.

With this change it is possible to add yet to be defined netlink
attributes to the dump request which should make it fairly extensible
in the future.

Signed-off-by: Greg Rose &lt;gregory.v.rose@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement a new netlink attribute type IFLA_EXT_MASK.  The mask
is a 32 bit value that can be used to indicate to the kernel that
certain extended ifinfo values are requested by the user application.
At this time the only mask value defined is RTEXT_FILTER_VF to
indicate that the user wants the ifinfo dump to send information
about the VFs belonging to the interface.

This patch fixes a bug in which certain applications do not have
large enough buffers to accommodate the extra information returned
by the kernel with large numbers of SR-IOV virtual functions.
Those applications will not send the new netlink attribute with
the interface info dump request netlink messages so they will
not get unexpectedly large request buffers returned by the kernel.

Modifies the rtnl_calcit function to traverse the list of net
devices and compute the minimum buffer size that can hold the
info dumps of all matching devices based upon the filter passed
in via the new netlink attribute filter mask.  If no filter
mask is sent then the buffer allocation defaults to NLMSG_GOODSIZE.

With this change it is possible to add yet to be defined netlink
attributes to the dump request which should make it fairly extensible
in the future.

Signed-off-by: Greg Rose &lt;gregory.v.rose@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem</title>
<updated>2012-02-20T19:47:17+00:00</updated>
<author>
<name>John W. Linville</name>
<email>linville@tuxdriver.com</email>
</author>
<published>2012-02-20T19:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9d4990a260ce395493848640bed94fb55f440f10'/>
<id>9d4990a260ce395493848640bed94fb55f440f10</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Remove usage of __cancel_delayed_work()</title>
<updated>2012-02-15T11:09:26+00:00</updated>
<author>
<name>Ulisses Furquim</name>
<email>ulisses@profusion.mobi</email>
</author>
<published>2012-01-30T20:26:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6de32750822d00bfa92c341166132b0714c5b559'/>
<id>6de32750822d00bfa92c341166132b0714c5b559</id>
<content type='text'>
__cancel_delayed_work() is being used in some paths where we cannot
sleep waiting for the delayed work to finish. However, that function
might return while the timer is running and the work will be queued
again. Replace the calls with safer cancel_delayed_work() version
which spins until the timer handler finishes on other CPUs and
cancels the delayed work.

Signed-off-by: Ulisses Furquim &lt;ulisses@profusion.mobi&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__cancel_delayed_work() is being used in some paths where we cannot
sleep waiting for the delayed work to finish. However, that function
might return while the timer is running and the work will be queued
again. Replace the calls with safer cancel_delayed_work() version
which spins until the timer handler finishes on other CPUs and
cancels the delayed work.

Signed-off-by: Ulisses Furquim &lt;ulisses@profusion.mobi&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Fix potential deadlock</title>
<updated>2012-02-15T11:09:26+00:00</updated>
<author>
<name>Andre Guedes</name>
<email>andre.guedes@openbossa.org</email>
</author>
<published>2012-01-27T22:42:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a51cd2be864a3cc0272359b1995e213341dfc7e7'/>
<id>a51cd2be864a3cc0272359b1995e213341dfc7e7</id>
<content type='text'>
We don't need to use the _sync variant in hci_conn_hold and
hci_conn_put to cancel conn-&gt;disc_work delayed work. This way
we avoid potential deadlocks like this one reported by lockdep.

======================================================
[ INFO: possible circular locking dependency detected ]
3.2.0+ #1 Not tainted
-------------------------------------------------------
kworker/u:1/17 is trying to acquire lock:
 (&amp;hdev-&gt;lock){+.+.+.}, at: [&lt;ffffffffa0041155&gt;] hci_conn_timeout+0x62/0x158 [bluetooth]

but task is already holding lock:
 ((&amp;(&amp;conn-&gt;disc_work)-&gt;work)){+.+...}, at: [&lt;ffffffff81035751&gt;] process_one_work+0x11a/0x2bf

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 ((&amp;(&amp;conn-&gt;disc_work)-&gt;work)){+.+...}:
       [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
       [&lt;ffffffff81034ed1&gt;] wait_on_work+0x3d/0xaa
       [&lt;ffffffff81035b54&gt;] __cancel_work_timer+0xac/0xef
       [&lt;ffffffff81035ba4&gt;] cancel_delayed_work_sync+0xd/0xf
       [&lt;ffffffffa00554b0&gt;] smp_chan_create+0xde/0xe6 [bluetooth]
       [&lt;ffffffffa0056160&gt;] smp_conn_security+0xa3/0x12d [bluetooth]
       [&lt;ffffffffa0053640&gt;] l2cap_connect_cfm+0x237/0x2e8 [bluetooth]
       [&lt;ffffffffa004239c&gt;] hci_proto_connect_cfm+0x2d/0x6f [bluetooth]
       [&lt;ffffffffa0046ea5&gt;] hci_event_packet+0x29d1/0x2d60 [bluetooth]
       [&lt;ffffffffa003dde3&gt;] hci_rx_work+0xd0/0x2e1 [bluetooth]
       [&lt;ffffffff810357af&gt;] process_one_work+0x178/0x2bf
       [&lt;ffffffff81036178&gt;] worker_thread+0xce/0x152
       [&lt;ffffffff81039a03&gt;] kthread+0x95/0x9d
       [&lt;ffffffff812e7754&gt;] kernel_thread_helper+0x4/0x10

-&gt; #1 (slock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+...}:
       [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
       [&lt;ffffffff812e553a&gt;] _raw_spin_lock_bh+0x36/0x6a
       [&lt;ffffffff81244d56&gt;] lock_sock_nested+0x24/0x7f
       [&lt;ffffffffa004d96f&gt;] lock_sock+0xb/0xd [bluetooth]
       [&lt;ffffffffa0052906&gt;] l2cap_chan_connect+0xa9/0x26f [bluetooth]
       [&lt;ffffffffa00545f8&gt;] l2cap_sock_connect+0xb3/0xff [bluetooth]
       [&lt;ffffffff81243b48&gt;] sys_connect+0x69/0x8a
       [&lt;ffffffff812e6579&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (&amp;hdev-&gt;lock){+.+.+.}:
       [&lt;ffffffff81056d06&gt;] __lock_acquire+0xa80/0xd74
       [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
       [&lt;ffffffff812e3870&gt;] __mutex_lock_common+0x48/0x38e
       [&lt;ffffffff812e3c75&gt;] mutex_lock_nested+0x2a/0x31
       [&lt;ffffffffa0041155&gt;] hci_conn_timeout+0x62/0x158 [bluetooth]
       [&lt;ffffffff810357af&gt;] process_one_work+0x178/0x2bf
       [&lt;ffffffff81036178&gt;] worker_thread+0xce/0x152
       [&lt;ffffffff81039a03&gt;] kthread+0x95/0x9d
       [&lt;ffffffff812e7754&gt;] kernel_thread_helper+0x4/0x10

other info that might help us debug this:

Chain exists of:
  &amp;hdev-&gt;lock --&gt; slock-AF_BLUETOOTH-BTPROTO_L2CAP --&gt; (&amp;(&amp;conn-&gt;disc_work)-&gt;work)

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock((&amp;(&amp;conn-&gt;disc_work)-&gt;work));
                               lock(slock-AF_BLUETOOTH-BTPROTO_L2CAP);
                               lock((&amp;(&amp;conn-&gt;disc_work)-&gt;work));
  lock(&amp;hdev-&gt;lock);

 *** DEADLOCK ***

2 locks held by kworker/u:1/17:
 #0:  (hdev-&gt;name){.+.+.+}, at: [&lt;ffffffff81035751&gt;] process_one_work+0x11a/0x2bf
 #1:  ((&amp;(&amp;conn-&gt;disc_work)-&gt;work)){+.+...}, at: [&lt;ffffffff81035751&gt;] process_one_work+0x11a/0x2bf

stack backtrace:
Pid: 17, comm: kworker/u:1 Not tainted 3.2.0+ #1
Call Trace:
 [&lt;ffffffff812e06c6&gt;] print_circular_bug+0x1f8/0x209
 [&lt;ffffffff81056d06&gt;] __lock_acquire+0xa80/0xd74
 [&lt;ffffffff81021ef2&gt;] ? arch_local_irq_restore+0x6/0xd
 [&lt;ffffffff81022bc7&gt;] ? vprintk+0x3f9/0x41e
 [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
 [&lt;ffffffffa0041155&gt;] ? hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff812e3870&gt;] __mutex_lock_common+0x48/0x38e
 [&lt;ffffffffa0041155&gt;] ? hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff81190fd6&gt;] ? __dynamic_pr_debug+0x6d/0x6f
 [&lt;ffffffffa0041155&gt;] ? hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff8105320f&gt;] ? trace_hardirqs_off+0xd/0xf
 [&lt;ffffffff812e3c75&gt;] mutex_lock_nested+0x2a/0x31
 [&lt;ffffffffa0041155&gt;] hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff810357af&gt;] process_one_work+0x178/0x2bf
 [&lt;ffffffff81035751&gt;] ? process_one_work+0x11a/0x2bf
 [&lt;ffffffff81055af3&gt;] ? lock_acquired+0x1d0/0x1df
 [&lt;ffffffffa00410f3&gt;] ? hci_acl_disconn+0x65/0x65 [bluetooth]
 [&lt;ffffffff81036178&gt;] worker_thread+0xce/0x152
 [&lt;ffffffff810407ed&gt;] ? finish_task_switch+0x45/0xc5
 [&lt;ffffffff810360aa&gt;] ? manage_workers.isra.25+0x16a/0x16a
 [&lt;ffffffff81039a03&gt;] kthread+0x95/0x9d
 [&lt;ffffffff812e7754&gt;] kernel_thread_helper+0x4/0x10
 [&lt;ffffffff812e5db4&gt;] ? retint_restore_args+0x13/0x13
 [&lt;ffffffff8103996e&gt;] ? __init_kthread_worker+0x55/0x55
 [&lt;ffffffff812e7750&gt;] ? gs_change+0x13/0x13

Signed-off-by: Andre Guedes &lt;andre.guedes@openbossa.org&gt;
Signed-off-by: Vinicius Costa Gomes &lt;vinicius.gomes@openbossa.org&gt;
Reviewed-by: Ulisses Furquim &lt;ulisses@profusion.mobi&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We don't need to use the _sync variant in hci_conn_hold and
hci_conn_put to cancel conn-&gt;disc_work delayed work. This way
we avoid potential deadlocks like this one reported by lockdep.

======================================================
[ INFO: possible circular locking dependency detected ]
3.2.0+ #1 Not tainted
-------------------------------------------------------
kworker/u:1/17 is trying to acquire lock:
 (&amp;hdev-&gt;lock){+.+.+.}, at: [&lt;ffffffffa0041155&gt;] hci_conn_timeout+0x62/0x158 [bluetooth]

but task is already holding lock:
 ((&amp;(&amp;conn-&gt;disc_work)-&gt;work)){+.+...}, at: [&lt;ffffffff81035751&gt;] process_one_work+0x11a/0x2bf

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-&gt; #2 ((&amp;(&amp;conn-&gt;disc_work)-&gt;work)){+.+...}:
       [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
       [&lt;ffffffff81034ed1&gt;] wait_on_work+0x3d/0xaa
       [&lt;ffffffff81035b54&gt;] __cancel_work_timer+0xac/0xef
       [&lt;ffffffff81035ba4&gt;] cancel_delayed_work_sync+0xd/0xf
       [&lt;ffffffffa00554b0&gt;] smp_chan_create+0xde/0xe6 [bluetooth]
       [&lt;ffffffffa0056160&gt;] smp_conn_security+0xa3/0x12d [bluetooth]
       [&lt;ffffffffa0053640&gt;] l2cap_connect_cfm+0x237/0x2e8 [bluetooth]
       [&lt;ffffffffa004239c&gt;] hci_proto_connect_cfm+0x2d/0x6f [bluetooth]
       [&lt;ffffffffa0046ea5&gt;] hci_event_packet+0x29d1/0x2d60 [bluetooth]
       [&lt;ffffffffa003dde3&gt;] hci_rx_work+0xd0/0x2e1 [bluetooth]
       [&lt;ffffffff810357af&gt;] process_one_work+0x178/0x2bf
       [&lt;ffffffff81036178&gt;] worker_thread+0xce/0x152
       [&lt;ffffffff81039a03&gt;] kthread+0x95/0x9d
       [&lt;ffffffff812e7754&gt;] kernel_thread_helper+0x4/0x10

-&gt; #1 (slock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+...}:
       [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
       [&lt;ffffffff812e553a&gt;] _raw_spin_lock_bh+0x36/0x6a
       [&lt;ffffffff81244d56&gt;] lock_sock_nested+0x24/0x7f
       [&lt;ffffffffa004d96f&gt;] lock_sock+0xb/0xd [bluetooth]
       [&lt;ffffffffa0052906&gt;] l2cap_chan_connect+0xa9/0x26f [bluetooth]
       [&lt;ffffffffa00545f8&gt;] l2cap_sock_connect+0xb3/0xff [bluetooth]
       [&lt;ffffffff81243b48&gt;] sys_connect+0x69/0x8a
       [&lt;ffffffff812e6579&gt;] system_call_fastpath+0x16/0x1b

-&gt; #0 (&amp;hdev-&gt;lock){+.+.+.}:
       [&lt;ffffffff81056d06&gt;] __lock_acquire+0xa80/0xd74
       [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
       [&lt;ffffffff812e3870&gt;] __mutex_lock_common+0x48/0x38e
       [&lt;ffffffff812e3c75&gt;] mutex_lock_nested+0x2a/0x31
       [&lt;ffffffffa0041155&gt;] hci_conn_timeout+0x62/0x158 [bluetooth]
       [&lt;ffffffff810357af&gt;] process_one_work+0x178/0x2bf
       [&lt;ffffffff81036178&gt;] worker_thread+0xce/0x152
       [&lt;ffffffff81039a03&gt;] kthread+0x95/0x9d
       [&lt;ffffffff812e7754&gt;] kernel_thread_helper+0x4/0x10

other info that might help us debug this:

Chain exists of:
  &amp;hdev-&gt;lock --&gt; slock-AF_BLUETOOTH-BTPROTO_L2CAP --&gt; (&amp;(&amp;conn-&gt;disc_work)-&gt;work)

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock((&amp;(&amp;conn-&gt;disc_work)-&gt;work));
                               lock(slock-AF_BLUETOOTH-BTPROTO_L2CAP);
                               lock((&amp;(&amp;conn-&gt;disc_work)-&gt;work));
  lock(&amp;hdev-&gt;lock);

 *** DEADLOCK ***

2 locks held by kworker/u:1/17:
 #0:  (hdev-&gt;name){.+.+.+}, at: [&lt;ffffffff81035751&gt;] process_one_work+0x11a/0x2bf
 #1:  ((&amp;(&amp;conn-&gt;disc_work)-&gt;work)){+.+...}, at: [&lt;ffffffff81035751&gt;] process_one_work+0x11a/0x2bf

stack backtrace:
Pid: 17, comm: kworker/u:1 Not tainted 3.2.0+ #1
Call Trace:
 [&lt;ffffffff812e06c6&gt;] print_circular_bug+0x1f8/0x209
 [&lt;ffffffff81056d06&gt;] __lock_acquire+0xa80/0xd74
 [&lt;ffffffff81021ef2&gt;] ? arch_local_irq_restore+0x6/0xd
 [&lt;ffffffff81022bc7&gt;] ? vprintk+0x3f9/0x41e
 [&lt;ffffffff81057444&gt;] lock_acquire+0x8a/0xa7
 [&lt;ffffffffa0041155&gt;] ? hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff812e3870&gt;] __mutex_lock_common+0x48/0x38e
 [&lt;ffffffffa0041155&gt;] ? hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff81190fd6&gt;] ? __dynamic_pr_debug+0x6d/0x6f
 [&lt;ffffffffa0041155&gt;] ? hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff8105320f&gt;] ? trace_hardirqs_off+0xd/0xf
 [&lt;ffffffff812e3c75&gt;] mutex_lock_nested+0x2a/0x31
 [&lt;ffffffffa0041155&gt;] hci_conn_timeout+0x62/0x158 [bluetooth]
 [&lt;ffffffff810357af&gt;] process_one_work+0x178/0x2bf
 [&lt;ffffffff81035751&gt;] ? process_one_work+0x11a/0x2bf
 [&lt;ffffffff81055af3&gt;] ? lock_acquired+0x1d0/0x1df
 [&lt;ffffffffa00410f3&gt;] ? hci_acl_disconn+0x65/0x65 [bluetooth]
 [&lt;ffffffff81036178&gt;] worker_thread+0xce/0x152
 [&lt;ffffffff810407ed&gt;] ? finish_task_switch+0x45/0xc5
 [&lt;ffffffff810360aa&gt;] ? manage_workers.isra.25+0x16a/0x16a
 [&lt;ffffffff81039a03&gt;] kthread+0x95/0x9d
 [&lt;ffffffff812e7754&gt;] kernel_thread_helper+0x4/0x10
 [&lt;ffffffff812e5db4&gt;] ? retint_restore_args+0x13/0x13
 [&lt;ffffffff8103996e&gt;] ? __init_kthread_worker+0x55/0x55
 [&lt;ffffffff812e7750&gt;] ? gs_change+0x13/0x13

Signed-off-by: Andre Guedes &lt;andre.guedes@openbossa.org&gt;
Signed-off-by: Vinicius Costa Gomes &lt;vinicius.gomes@openbossa.org&gt;
Reviewed-by: Ulisses Furquim &lt;ulisses@profusion.mobi&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: silence lockdep warning</title>
<updated>2012-02-15T11:09:26+00:00</updated>
<author>
<name>Octavian Purdila</name>
<email>tavi.purdila@gmail.com</email>
</author>
<published>2012-01-21T22:28:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b5a30dda6598af216c070165ece6068f9f00f33a'/>
<id>b5a30dda6598af216c070165ece6068f9f00f33a</id>
<content type='text'>
Since bluetooth uses multiple protocols types, to avoid lockdep
warnings, we need to use different lockdep classes (one for each
protocol type).

This is already done in bt_sock_create but it misses a couple of cases
when new connections are created. This patch corrects that to fix the
following warning:

&lt;4&gt;[ 1864.732366] =======================================================
&lt;4&gt;[ 1864.733030] [ INFO: possible circular locking dependency detected ]
&lt;4&gt;[ 1864.733544] 3.0.16-mid3-00007-gc9a0f62 #3
&lt;4&gt;[ 1864.733883] -------------------------------------------------------
&lt;4&gt;[ 1864.734408] t.android.btclc/4204 is trying to acquire lock:
&lt;4&gt;[ 1864.734869]  (rfcomm_mutex){+.+.+.}, at: [&lt;c14970ea&gt;] rfcomm_dlc_close+0x15/0x30
&lt;4&gt;[ 1864.735541]
&lt;4&gt;[ 1864.735549] but task is already holding lock:
&lt;4&gt;[ 1864.736045]  (sk_lock-AF_BLUETOOTH){+.+.+.}, at: [&lt;c1498bf7&gt;] lock_sock+0xa/0xc
&lt;4&gt;[ 1864.736732]
&lt;4&gt;[ 1864.736740] which lock already depends on the new lock.
&lt;4&gt;[ 1864.736750]
&lt;4&gt;[ 1864.737428]
&lt;4&gt;[ 1864.737437] the existing dependency chain (in reverse order) is:
&lt;4&gt;[ 1864.738016]
&lt;4&gt;[ 1864.738023] -&gt; #1 (sk_lock-AF_BLUETOOTH){+.+.+.}:
&lt;4&gt;[ 1864.738549]        [&lt;c1062273&gt;] lock_acquire+0x104/0x140
&lt;4&gt;[ 1864.738977]        [&lt;c13d35c1&gt;] lock_sock_nested+0x58/0x68
&lt;4&gt;[ 1864.739411]        [&lt;c1493c33&gt;] l2cap_sock_sendmsg+0x3e/0x76
&lt;4&gt;[ 1864.739858]        [&lt;c13d06c3&gt;] __sock_sendmsg+0x50/0x59
&lt;4&gt;[ 1864.740279]        [&lt;c13d0ea2&gt;] sock_sendmsg+0x94/0xa8
&lt;4&gt;[ 1864.740687]        [&lt;c13d0ede&gt;] kernel_sendmsg+0x28/0x37
&lt;4&gt;[ 1864.741106]        [&lt;c14969ca&gt;] rfcomm_send_frame+0x30/0x38
&lt;4&gt;[ 1864.741542]        [&lt;c1496a2a&gt;] rfcomm_send_ua+0x58/0x5a
&lt;4&gt;[ 1864.741959]        [&lt;c1498447&gt;] rfcomm_run+0x441/0xb52
&lt;4&gt;[ 1864.742365]        [&lt;c104f095&gt;] kthread+0x63/0x68
&lt;4&gt;[ 1864.742742]        [&lt;c14d5182&gt;] kernel_thread_helper+0x6/0xd
&lt;4&gt;[ 1864.743187]
&lt;4&gt;[ 1864.743193] -&gt; #0 (rfcomm_mutex){+.+.+.}:
&lt;4&gt;[ 1864.743667]        [&lt;c1061ada&gt;] __lock_acquire+0x988/0xc00
&lt;4&gt;[ 1864.744100]        [&lt;c1062273&gt;] lock_acquire+0x104/0x140
&lt;4&gt;[ 1864.744519]        [&lt;c14d2c70&gt;] __mutex_lock_common+0x3b/0x33f
&lt;4&gt;[ 1864.744975]        [&lt;c14d303e&gt;] mutex_lock_nested+0x2d/0x36
&lt;4&gt;[ 1864.745412]        [&lt;c14970ea&gt;] rfcomm_dlc_close+0x15/0x30
&lt;4&gt;[ 1864.745842]        [&lt;c14990d9&gt;] __rfcomm_sock_close+0x5f/0x6b
&lt;4&gt;[ 1864.746288]        [&lt;c1499114&gt;] rfcomm_sock_shutdown+0x2f/0x62
&lt;4&gt;[ 1864.746737]        [&lt;c13d275d&gt;] sys_socketcall+0x1db/0x422
&lt;4&gt;[ 1864.747165]        [&lt;c14d42f0&gt;] syscall_call+0x7/0xb

Signed-off-by: Octavian Purdila &lt;octavian.purdila@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since bluetooth uses multiple protocols types, to avoid lockdep
warnings, we need to use different lockdep classes (one for each
protocol type).

This is already done in bt_sock_create but it misses a couple of cases
when new connections are created. This patch corrects that to fix the
following warning:

&lt;4&gt;[ 1864.732366] =======================================================
&lt;4&gt;[ 1864.733030] [ INFO: possible circular locking dependency detected ]
&lt;4&gt;[ 1864.733544] 3.0.16-mid3-00007-gc9a0f62 #3
&lt;4&gt;[ 1864.733883] -------------------------------------------------------
&lt;4&gt;[ 1864.734408] t.android.btclc/4204 is trying to acquire lock:
&lt;4&gt;[ 1864.734869]  (rfcomm_mutex){+.+.+.}, at: [&lt;c14970ea&gt;] rfcomm_dlc_close+0x15/0x30
&lt;4&gt;[ 1864.735541]
&lt;4&gt;[ 1864.735549] but task is already holding lock:
&lt;4&gt;[ 1864.736045]  (sk_lock-AF_BLUETOOTH){+.+.+.}, at: [&lt;c1498bf7&gt;] lock_sock+0xa/0xc
&lt;4&gt;[ 1864.736732]
&lt;4&gt;[ 1864.736740] which lock already depends on the new lock.
&lt;4&gt;[ 1864.736750]
&lt;4&gt;[ 1864.737428]
&lt;4&gt;[ 1864.737437] the existing dependency chain (in reverse order) is:
&lt;4&gt;[ 1864.738016]
&lt;4&gt;[ 1864.738023] -&gt; #1 (sk_lock-AF_BLUETOOTH){+.+.+.}:
&lt;4&gt;[ 1864.738549]        [&lt;c1062273&gt;] lock_acquire+0x104/0x140
&lt;4&gt;[ 1864.738977]        [&lt;c13d35c1&gt;] lock_sock_nested+0x58/0x68
&lt;4&gt;[ 1864.739411]        [&lt;c1493c33&gt;] l2cap_sock_sendmsg+0x3e/0x76
&lt;4&gt;[ 1864.739858]        [&lt;c13d06c3&gt;] __sock_sendmsg+0x50/0x59
&lt;4&gt;[ 1864.740279]        [&lt;c13d0ea2&gt;] sock_sendmsg+0x94/0xa8
&lt;4&gt;[ 1864.740687]        [&lt;c13d0ede&gt;] kernel_sendmsg+0x28/0x37
&lt;4&gt;[ 1864.741106]        [&lt;c14969ca&gt;] rfcomm_send_frame+0x30/0x38
&lt;4&gt;[ 1864.741542]        [&lt;c1496a2a&gt;] rfcomm_send_ua+0x58/0x5a
&lt;4&gt;[ 1864.741959]        [&lt;c1498447&gt;] rfcomm_run+0x441/0xb52
&lt;4&gt;[ 1864.742365]        [&lt;c104f095&gt;] kthread+0x63/0x68
&lt;4&gt;[ 1864.742742]        [&lt;c14d5182&gt;] kernel_thread_helper+0x6/0xd
&lt;4&gt;[ 1864.743187]
&lt;4&gt;[ 1864.743193] -&gt; #0 (rfcomm_mutex){+.+.+.}:
&lt;4&gt;[ 1864.743667]        [&lt;c1061ada&gt;] __lock_acquire+0x988/0xc00
&lt;4&gt;[ 1864.744100]        [&lt;c1062273&gt;] lock_acquire+0x104/0x140
&lt;4&gt;[ 1864.744519]        [&lt;c14d2c70&gt;] __mutex_lock_common+0x3b/0x33f
&lt;4&gt;[ 1864.744975]        [&lt;c14d303e&gt;] mutex_lock_nested+0x2d/0x36
&lt;4&gt;[ 1864.745412]        [&lt;c14970ea&gt;] rfcomm_dlc_close+0x15/0x30
&lt;4&gt;[ 1864.745842]        [&lt;c14990d9&gt;] __rfcomm_sock_close+0x5f/0x6b
&lt;4&gt;[ 1864.746288]        [&lt;c1499114&gt;] rfcomm_sock_shutdown+0x2f/0x62
&lt;4&gt;[ 1864.746737]        [&lt;c13d275d&gt;] sys_socketcall+0x1db/0x422
&lt;4&gt;[ 1864.747165]        [&lt;c14d42f0&gt;] syscall_call+0x7/0xb

Signed-off-by: Octavian Purdila &lt;octavian.purdila@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
