<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/rose, branch v2.6.28</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>rose: zero length frame filtering in af_rose.c</title>
<updated>2008-11-25T08:56:20+00:00</updated>
<author>
<name>Bernard Pidoux</name>
<email>bernard.pidoux@upmc.fr</email>
</author>
<published>2008-11-24T11:49:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=244f46ae6e9e18f6fc0be7d1f49febde4762c34b'/>
<id>244f46ae6e9e18f6fc0be7d1f49febde4762c34b</id>
<content type='text'>
Since changeset e79ad711a0108475c1b3a03815527e7237020b08 from  mainline,
&gt;From David S. Miller,
empty packet can be transmitted on connected socket for datagram protocols.

However, this patch broke a high level application using ROSE network protocol with connected datagram.

Bulletin Board Stations perform bulletins forwarding between BBS stations via ROSE network using a forward protocol.
Now, if for some reason, a buffer in the application software happens to be empty at a specific moment,
ROSE sends an empty packet via unfiltered packet socket.
When received, this ROSE packet introduces perturbations of data exchange of BBS forwarding,
for the application message forwarding protocol is waiting for something else.
We agree that a more careful programming of the application protocol would avoid this situation and we are
willing to debug it.
But, as an empty frame is no use and does not have any meaning for ROSE protocol,
we may consider filtering zero length data both when sending and receiving socket data.

The proposed patch repaired BBS data exchange through ROSE network that were broken since 2.6.22.11 kernel.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&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>
Since changeset e79ad711a0108475c1b3a03815527e7237020b08 from  mainline,
&gt;From David S. Miller,
empty packet can be transmitted on connected socket for datagram protocols.

However, this patch broke a high level application using ROSE network protocol with connected datagram.

Bulletin Board Stations perform bulletins forwarding between BBS stations via ROSE network using a forward protocol.
Now, if for some reason, a buffer in the application software happens to be empty at a specific moment,
ROSE sends an empty packet via unfiltered packet socket.
When received, this ROSE packet introduces perturbations of data exchange of BBS forwarding,
for the application message forwarding protocol is waiting for something else.
We agree that a more careful programming of the application protocol would avoid this situation and we are
willing to debug it.
But, as an empty frame is no use and does not have any meaning for ROSE protocol,
we may consider filtering zero length data both when sending and receiving socket data.

The proposed patch repaired BBS data exchange through ROSE network that were broken since 2.6.22.11 kernel.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdev: Handle -&gt;addr_list_lock just like -&gt;_xmit_lock for lockdep.</title>
<updated>2008-07-22T21:16:42+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-07-22T21:16:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf508b1211dbe576778ff445ea1b4b0bcfa5c4ea'/>
<id>cf508b1211dbe576778ff445ea1b4b0bcfa5c4ea</id>
<content type='text'>
The new address list lock needs to handle the same device layering
issues that the _xmit_lock one does.

This integrates work done by Patrick McHardy.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new address list lock needs to handle the same device layering
issues that the _xmit_lock one does.

This integrates work done by Patrick McHardy.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netns: Use net_eq() to compare net-namespaces for optimization.</title>
<updated>2008-07-20T05:34:43+00:00</updated>
<author>
<name>YOSHIFUJI Hideaki</name>
<email>yoshfuji@linux-ipv6.org</email>
</author>
<published>2008-07-20T05:34:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=721499e8931c5732202481ae24f2dfbf9910f129'/>
<id>721499e8931c5732202481ae24f2dfbf9910f129</id>
<content type='text'>
Without CONFIG_NET_NS, namespace is always &amp;init_net.
Compiler will be able to omit namespace comparisons with this patch.

Signed-off-by: YOSHIFUJI Hideaki &lt;yoshfuji@linux-ipv6.org&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>
Without CONFIG_NET_NS, namespace is always &amp;init_net.
Compiler will be able to omit namespace comparisons with this patch.

Signed-off-by: YOSHIFUJI Hideaki &lt;yoshfuji@linux-ipv6.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdev: Allocate multiple queues for TX.</title>
<updated>2008-07-18T02:21:00+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-07-17T07:34:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e8a0464cc950972824e2e128028ae3db666ec1ed'/>
<id>e8a0464cc950972824e2e128028ae3db666ec1ed</id>
<content type='text'>
alloc_netdev_mq() now allocates an array of netdev_queue
structures for TX, based upon the queue_count argument.

Furthermore, all accesses to the TX queues are now vectored
through the netdev_get_tx_queue() and netdev_for_each_tx_queue()
interfaces.  This makes it easy to grep the tree for all
things that want to get to a TX queue of a net device.

Problem spots which are not really multiqueue aware yet, and
only work with one queue, can easily be spotted by grepping
for all netdev_get_tx_queue() calls that pass in a zero index.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
alloc_netdev_mq() now allocates an array of netdev_queue
structures for TX, based upon the queue_count argument.

Furthermore, all accesses to the TX queues are now vectored
through the netdev_get_tx_queue() and netdev_for_each_tx_queue()
interfaces.  This makes it easy to grep the tree for all
things that want to get to a TX queue of a net device.

Problem spots which are not really multiqueue aware yet, and
only work with one queue, can easily be spotted by grepping
for all netdev_get_tx_queue() calls that pass in a zero index.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netdev: Move _xmit_lock and xmit_lock_owner into netdev_queue.</title>
<updated>2008-07-09T06:13:53+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-07-09T06:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c773e847ea8f6812804e40f52399c6921a00eab1'/>
<id>c773e847ea8f6812804e40f52399c6921a00eab1</id>
<content type='text'>
Accesses are mostly structured such that when there are multiple TX
queues the code transformations will be a little bit simpler.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Accesses are mostly structured such that when there are multiple TX
queues the code transformations will be a little bit simpler.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rose: improving AX25 routing frames via ROSE network</title>
<updated>2008-06-18T00:08:32+00:00</updated>
<author>
<name>Bernard Pidoux</name>
<email>f6bvp@amsat.org</email>
</author>
<published>2008-06-18T00:08:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe2c802ab62aa63d276deafa905875f3455f2621'/>
<id>fe2c802ab62aa63d276deafa905875f3455f2621</id>
<content type='text'>
ROSE network is organized through nodes connected via hamradio or Internet.
AX25 packet radio frames sent to a remote ROSE address destination are routed
through these nodes.

Without the present patch, automatic routing mechanism did not work optimally
due to an improper parameter checking.

rose_get_neigh() function is called either by rose_connect() or by
rose_route_frame().

In the case of a call from rose_connect(), f0 timer is checked to find if a connection
is already pending. In that case it returns the address of the neighbour, or returns a NULL otherwise.

When called by rose_route_frame() the purpose was to route a packet AX25 frame
through an adjacent node given a destination rose address.
However, in that case, t0 timer checked does not indicate if the adjacent node
is actually connected even if the timer is not null. Thus, for each frame sent, the
function often tried to start a new connexion even if the adjacent node was already connected.

The patch adds a "new" parameter that is true when the function is called by
rose route_frame().
This instructs rose_get_neigh() to check node parameter "restarted". 
If restarted is true it means that the route to the destination address is opened via a neighbour
node already connected.
If "restarted" is false the function returns a NULL.
In that case the calling function will initiate a new connection as before.

This results in a fast routing of frames, from nodes to nodes, until
destination is reached, as originaly specified by ROSE protocole.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&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>
ROSE network is organized through nodes connected via hamradio or Internet.
AX25 packet radio frames sent to a remote ROSE address destination are routed
through these nodes.

Without the present patch, automatic routing mechanism did not work optimally
due to an improper parameter checking.

rose_get_neigh() function is called either by rose_connect() or by
rose_route_frame().

In the case of a call from rose_connect(), f0 timer is checked to find if a connection
is already pending. In that case it returns the address of the neighbour, or returns a NULL otherwise.

When called by rose_route_frame() the purpose was to route a packet AX25 frame
through an adjacent node given a destination rose address.
However, in that case, t0 timer checked does not indicate if the adjacent node
is actually connected even if the timer is not null. Thus, for each frame sent, the
function often tried to start a new connexion even if the adjacent node was already connected.

The patch adds a "new" parameter that is true when the function is called by
rose route_frame().
This instructs rose_get_neigh() to check node parameter "restarted". 
If restarted is true it means that the route to the destination address is opened via a neighbour
node already connected.
If "restarted" is false the function returns a NULL.
In that case the calling function will initiate a new connection as before.

This results in a fast routing of frames, from nodes to nodes, until
destination is reached, as originaly specified by ROSE protocole.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rose: Use sock_graft() and remove bogus sk_socket and sk_sleep init.</title>
<updated>2008-06-17T09:39:21+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2008-06-17T09:39:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=44ccff1f539c8c5bbfc1eacd41cb9ef65022a4ca'/>
<id>44ccff1f539c8c5bbfc1eacd41cb9ef65022a4ca</id>
<content type='text'>
This is the rose variant of changeset
9375cb8a1232d2a15fe34bec4d3474872e02faec
("ax25: Use sock_graft() and remove bogus sk_socket and sk_sleep init.")

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the rose variant of changeset
9375cb8a1232d2a15fe34bec4d3474872e02faec
("ax25: Use sock_graft() and remove bogus sk_socket and sk_sleep init.")

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rose: Wrong list_lock argument in rose_node seqops</title>
<updated>2008-05-03T00:03:22+00:00</updated>
<author>
<name>Bernard Pidoux</name>
<email>f6bvp@amsat.org</email>
</author>
<published>2008-05-03T00:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f37f2c62a28e848e06399ea2f9be1e098212625c'/>
<id>f37f2c62a28e848e06399ea2f9be1e098212625c</id>
<content type='text'>
In rose_node_start() as well as in rose_node_stop() __acquires() and
spin_lock_bh() were wrongly passing rose_neigh_list_lock instead of
rose_node_list_lock arguments.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&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>
In rose_node_start() as well as in rose_node_stop() __acquires() and
spin_lock_bh() were wrongly passing rose_neigh_list_lock instead of
rose_node_list_lock arguments.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[ROSE]: Fix soft lockup wrt. rose_node_list_lock</title>
<updated>2008-04-20T22:58:07+00:00</updated>
<author>
<name>Bernard Pidoux</name>
<email>f6bvp@amsat.org</email>
</author>
<published>2008-04-20T22:58:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=047f7617eba3653ff3bcfbe902986903fff2ed3b'/>
<id>047f7617eba3653ff3bcfbe902986903fff2ed3b</id>
<content type='text'>
[ INFO: possible recursive locking detected ]
2.6.25 #3
---------------------------------------------
ax25ipd/3811 is trying to acquire lock:
  (rose_node_list_lock){-+..}, at: [&lt;f8d31f1a&gt;] rose_get_neigh+0x1a/0xa0 
[rose]

but task is already holding lock:
  (rose_node_list_lock){-+..}, at: [&lt;f8d31fed&gt;] 
rose_route_frame+0x4d/0x620 [rose]

other info that might help us debug this:
6 locks held by ax25ipd/3811:
  #0:  (&amp;tty-&gt;atomic_write_lock){--..}, at: [&lt;c0259a1c&gt;] 
tty_write_lock+0x1c/0x50
  #1:  (rcu_read_lock){..--}, at: [&lt;c02aea36&gt;] net_rx_action+0x96/0x230
  #2:  (rcu_read_lock){..--}, at: [&lt;c02ac5c0&gt;] netif_receive_skb+0x100/0x2f0
  #3:  (rose_node_list_lock){-+..}, at: [&lt;f8d31fed&gt;] 
rose_route_frame+0x4d/0x620 [rose]
  #4:  (rose_neigh_list_lock){-+..}, at: [&lt;f8d31ff7&gt;] 
rose_route_frame+0x57/0x620 [rose]
  #5:  (rose_route_list_lock){-+..}, at: [&lt;f8d32001&gt;] 
rose_route_frame+0x61/0x620 [rose]

stack backtrace:
Pid: 3811, comm: ax25ipd Not tainted 2.6.25 #3
  [&lt;c0147e27&gt;] print_deadlock_bug+0xc7/0xd0
  [&lt;c0147eca&gt;] check_deadlock+0x9a/0xb0
  [&lt;c0149cd2&gt;] validate_chain+0x1e2/0x310
  [&lt;c0149b95&gt;] ? validate_chain+0xa5/0x310
  [&lt;c010a7d8&gt;] ? native_sched_clock+0x88/0xc0
  [&lt;c0149fa1&gt;] __lock_acquire+0x1a1/0x750
  [&lt;c014a5d1&gt;] lock_acquire+0x81/0xa0
  [&lt;f8d31f1a&gt;] ? rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;c03201a3&gt;] _spin_lock_bh+0x33/0x60
  [&lt;f8d31f1a&gt;] ? rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d31f1a&gt;] rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d32404&gt;] rose_route_frame+0x464/0x620 [rose]
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;f8d31fa0&gt;] ? rose_route_frame+0x0/0x620 [rose]
  [&lt;f8d1c396&gt;] ax25_rx_iframe+0x66/0x3b0 [ax25]
  [&lt;f8d1f42f&gt;] ? ax25_start_t3timer+0x1f/0x40 [ax25]
  [&lt;f8d1e65b&gt;] ax25_std_frame_in+0x7fb/0x890 [ax25]
  [&lt;c0320005&gt;] ? _spin_unlock_bh+0x25/0x30
  [&lt;f8d1bdf6&gt;] ax25_kiss_rcv+0x2c6/0x800 [ax25]
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c014a8a7&gt;] ? __lock_release+0x47/0x70
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c02a4d3a&gt;] ? sock_queue_rcv_skb+0x13a/0x1d0
  [&lt;c02a4c45&gt;] ? sock_queue_rcv_skb+0x45/0x1d0
  [&lt;f8d1bb30&gt;] ? ax25_kiss_rcv+0x0/0x800 [ax25]
  [&lt;c02ac715&gt;] netif_receive_skb+0x255/0x2f0
  [&lt;c02ac5c0&gt;] ? netif_receive_skb+0x100/0x2f0
  [&lt;c02af05c&gt;] process_backlog+0x7c/0xf0
  [&lt;c02aeb0c&gt;] net_rx_action+0x16c/0x230
  [&lt;c02aea36&gt;] ? net_rx_action+0x96/0x230
  [&lt;c012bd53&gt;] __do_softirq+0x93/0x120
  [&lt;f8d2a68a&gt;] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c012be37&gt;] do_softirq+0x57/0x60
  [&lt;c012c265&gt;] local_bh_enable_ip+0xa5/0xe0
  [&lt;c0320005&gt;] _spin_unlock_bh+0x25/0x30
  [&lt;f8d2a68a&gt;] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c025ea37&gt;] pty_write+0x47/0x60
  [&lt;c025c620&gt;] write_chan+0x1b0/0x220
  [&lt;c0259a1c&gt;] ? tty_write_lock+0x1c/0x50
  [&lt;c011fec0&gt;] ? default_wake_function+0x0/0x10
  [&lt;c0259bea&gt;] tty_write+0x12a/0x1c0
  [&lt;c025c470&gt;] ? write_chan+0x0/0x220
  [&lt;c018bbc6&gt;] vfs_write+0x96/0x130
  [&lt;c0259ac0&gt;] ? tty_write+0x0/0x1c0
  [&lt;c018c24d&gt;] sys_write+0x3d/0x70
  [&lt;c0104d1e&gt;] sysenter_past_esp+0x5f/0xa5
  =======================
BUG: soft lockup - CPU#0 stuck for 61s! [ax25ipd:3811]

Pid: 3811, comm: ax25ipd Not tainted (2.6.25 #3)
EIP: 0060:[&lt;c010a9db&gt;] EFLAGS: 00000246 CPU: 0
EIP is at native_read_tsc+0xb/0x20
EAX: b404aa2c EBX: b404a9c9 ECX: 017f1000 EDX: 0000076b
ESI: 00000001 EDI: 00000000 EBP: ecc83afc ESP: ecc83afc
  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
CR0: 8005003b CR2: b7f5f000 CR3: 2cd8e000 CR4: 000006f0
DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
DR6: ffff0ff0 DR7: 00000400
  [&lt;c0204937&gt;] delay_tsc+0x17/0x30
  [&lt;c02048e9&gt;] __delay+0x9/0x10
  [&lt;c02127f6&gt;] __spin_lock_debug+0x76/0xf0
  [&lt;c0212618&gt;] ? spin_bug+0x18/0x100
  [&lt;c0147923&gt;] ? __lock_contended+0xa3/0x110
  [&lt;c0212998&gt;] _raw_spin_lock+0x68/0x90
  [&lt;c03201bf&gt;] _spin_lock_bh+0x4f/0x60
  [&lt;f8d31f1a&gt;] ? rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d31f1a&gt;] rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d32404&gt;] rose_route_frame+0x464/0x620 [rose]
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;f8d31fa0&gt;] ? rose_route_frame+0x0/0x620 [rose]
  [&lt;f8d1c396&gt;] ax25_rx_iframe+0x66/0x3b0 [ax25]
  [&lt;f8d1f42f&gt;] ? ax25_start_t3timer+0x1f/0x40 [ax25]
  [&lt;f8d1e65b&gt;] ax25_std_frame_in+0x7fb/0x890 [ax25]
  [&lt;c0320005&gt;] ? _spin_unlock_bh+0x25/0x30
  [&lt;f8d1bdf6&gt;] ax25_kiss_rcv+0x2c6/0x800 [ax25]
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c014a8a7&gt;] ? __lock_release+0x47/0x70
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c02a4d3a&gt;] ? sock_queue_rcv_skb+0x13a/0x1d0
  [&lt;c02a4c45&gt;] ? sock_queue_rcv_skb+0x45/0x1d0
  [&lt;f8d1bb30&gt;] ? ax25_kiss_rcv+0x0/0x800 [ax25]
  [&lt;c02ac715&gt;] netif_receive_skb+0x255/0x2f0
  [&lt;c02ac5c0&gt;] ? netif_receive_skb+0x100/0x2f0
  [&lt;c02af05c&gt;] process_backlog+0x7c/0xf0
  [&lt;c02aeb0c&gt;] net_rx_action+0x16c/0x230
  [&lt;c02aea36&gt;] ? net_rx_action+0x96/0x230
  [&lt;c012bd53&gt;] __do_softirq+0x93/0x120
  [&lt;f8d2a68a&gt;] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c012be37&gt;] do_softirq+0x57/0x60
  [&lt;c012c265&gt;] local_bh_enable_ip+0xa5/0xe0
  [&lt;c0320005&gt;] _spin_unlock_bh+0x25/0x30
  [&lt;f8d2a68a&gt;] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c025ea37&gt;] pty_write+0x47/0x60
  [&lt;c025c620&gt;] write_chan+0x1b0/0x220
  [&lt;c0259a1c&gt;] ? tty_write_lock+0x1c/0x50
  [&lt;c011fec0&gt;] ? default_wake_function+0x0/0x10
  [&lt;c0259bea&gt;] tty_write+0x12a/0x1c0
  [&lt;c025c470&gt;] ? write_chan+0x0/0x220
  [&lt;c018bbc6&gt;] vfs_write+0x96/0x130
  [&lt;c0259ac0&gt;] ? tty_write+0x0/0x1c0
  [&lt;c018c24d&gt;] sys_write+0x3d/0x70
  [&lt;c0104d1e&gt;] sysenter_past_esp+0x5f/0xa5
  =======================

Since rose_route_frame() does not use rose_node_list we can safely
remove rose_node_list_lock spin lock here and let it be free for
rose_get_neigh().

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&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>
[ INFO: possible recursive locking detected ]
2.6.25 #3
---------------------------------------------
ax25ipd/3811 is trying to acquire lock:
  (rose_node_list_lock){-+..}, at: [&lt;f8d31f1a&gt;] rose_get_neigh+0x1a/0xa0 
[rose]

but task is already holding lock:
  (rose_node_list_lock){-+..}, at: [&lt;f8d31fed&gt;] 
rose_route_frame+0x4d/0x620 [rose]

other info that might help us debug this:
6 locks held by ax25ipd/3811:
  #0:  (&amp;tty-&gt;atomic_write_lock){--..}, at: [&lt;c0259a1c&gt;] 
tty_write_lock+0x1c/0x50
  #1:  (rcu_read_lock){..--}, at: [&lt;c02aea36&gt;] net_rx_action+0x96/0x230
  #2:  (rcu_read_lock){..--}, at: [&lt;c02ac5c0&gt;] netif_receive_skb+0x100/0x2f0
  #3:  (rose_node_list_lock){-+..}, at: [&lt;f8d31fed&gt;] 
rose_route_frame+0x4d/0x620 [rose]
  #4:  (rose_neigh_list_lock){-+..}, at: [&lt;f8d31ff7&gt;] 
rose_route_frame+0x57/0x620 [rose]
  #5:  (rose_route_list_lock){-+..}, at: [&lt;f8d32001&gt;] 
rose_route_frame+0x61/0x620 [rose]

stack backtrace:
Pid: 3811, comm: ax25ipd Not tainted 2.6.25 #3
  [&lt;c0147e27&gt;] print_deadlock_bug+0xc7/0xd0
  [&lt;c0147eca&gt;] check_deadlock+0x9a/0xb0
  [&lt;c0149cd2&gt;] validate_chain+0x1e2/0x310
  [&lt;c0149b95&gt;] ? validate_chain+0xa5/0x310
  [&lt;c010a7d8&gt;] ? native_sched_clock+0x88/0xc0
  [&lt;c0149fa1&gt;] __lock_acquire+0x1a1/0x750
  [&lt;c014a5d1&gt;] lock_acquire+0x81/0xa0
  [&lt;f8d31f1a&gt;] ? rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;c03201a3&gt;] _spin_lock_bh+0x33/0x60
  [&lt;f8d31f1a&gt;] ? rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d31f1a&gt;] rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d32404&gt;] rose_route_frame+0x464/0x620 [rose]
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;f8d31fa0&gt;] ? rose_route_frame+0x0/0x620 [rose]
  [&lt;f8d1c396&gt;] ax25_rx_iframe+0x66/0x3b0 [ax25]
  [&lt;f8d1f42f&gt;] ? ax25_start_t3timer+0x1f/0x40 [ax25]
  [&lt;f8d1e65b&gt;] ax25_std_frame_in+0x7fb/0x890 [ax25]
  [&lt;c0320005&gt;] ? _spin_unlock_bh+0x25/0x30
  [&lt;f8d1bdf6&gt;] ax25_kiss_rcv+0x2c6/0x800 [ax25]
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c014a8a7&gt;] ? __lock_release+0x47/0x70
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c02a4d3a&gt;] ? sock_queue_rcv_skb+0x13a/0x1d0
  [&lt;c02a4c45&gt;] ? sock_queue_rcv_skb+0x45/0x1d0
  [&lt;f8d1bb30&gt;] ? ax25_kiss_rcv+0x0/0x800 [ax25]
  [&lt;c02ac715&gt;] netif_receive_skb+0x255/0x2f0
  [&lt;c02ac5c0&gt;] ? netif_receive_skb+0x100/0x2f0
  [&lt;c02af05c&gt;] process_backlog+0x7c/0xf0
  [&lt;c02aeb0c&gt;] net_rx_action+0x16c/0x230
  [&lt;c02aea36&gt;] ? net_rx_action+0x96/0x230
  [&lt;c012bd53&gt;] __do_softirq+0x93/0x120
  [&lt;f8d2a68a&gt;] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c012be37&gt;] do_softirq+0x57/0x60
  [&lt;c012c265&gt;] local_bh_enable_ip+0xa5/0xe0
  [&lt;c0320005&gt;] _spin_unlock_bh+0x25/0x30
  [&lt;f8d2a68a&gt;] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c025ea37&gt;] pty_write+0x47/0x60
  [&lt;c025c620&gt;] write_chan+0x1b0/0x220
  [&lt;c0259a1c&gt;] ? tty_write_lock+0x1c/0x50
  [&lt;c011fec0&gt;] ? default_wake_function+0x0/0x10
  [&lt;c0259bea&gt;] tty_write+0x12a/0x1c0
  [&lt;c025c470&gt;] ? write_chan+0x0/0x220
  [&lt;c018bbc6&gt;] vfs_write+0x96/0x130
  [&lt;c0259ac0&gt;] ? tty_write+0x0/0x1c0
  [&lt;c018c24d&gt;] sys_write+0x3d/0x70
  [&lt;c0104d1e&gt;] sysenter_past_esp+0x5f/0xa5
  =======================
BUG: soft lockup - CPU#0 stuck for 61s! [ax25ipd:3811]

Pid: 3811, comm: ax25ipd Not tainted (2.6.25 #3)
EIP: 0060:[&lt;c010a9db&gt;] EFLAGS: 00000246 CPU: 0
EIP is at native_read_tsc+0xb/0x20
EAX: b404aa2c EBX: b404a9c9 ECX: 017f1000 EDX: 0000076b
ESI: 00000001 EDI: 00000000 EBP: ecc83afc ESP: ecc83afc
  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
CR0: 8005003b CR2: b7f5f000 CR3: 2cd8e000 CR4: 000006f0
DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
DR6: ffff0ff0 DR7: 00000400
  [&lt;c0204937&gt;] delay_tsc+0x17/0x30
  [&lt;c02048e9&gt;] __delay+0x9/0x10
  [&lt;c02127f6&gt;] __spin_lock_debug+0x76/0xf0
  [&lt;c0212618&gt;] ? spin_bug+0x18/0x100
  [&lt;c0147923&gt;] ? __lock_contended+0xa3/0x110
  [&lt;c0212998&gt;] _raw_spin_lock+0x68/0x90
  [&lt;c03201bf&gt;] _spin_lock_bh+0x4f/0x60
  [&lt;f8d31f1a&gt;] ? rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d31f1a&gt;] rose_get_neigh+0x1a/0xa0 [rose]
  [&lt;f8d32404&gt;] rose_route_frame+0x464/0x620 [rose]
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;f8d31fa0&gt;] ? rose_route_frame+0x0/0x620 [rose]
  [&lt;f8d1c396&gt;] ax25_rx_iframe+0x66/0x3b0 [ax25]
  [&lt;f8d1f42f&gt;] ? ax25_start_t3timer+0x1f/0x40 [ax25]
  [&lt;f8d1e65b&gt;] ax25_std_frame_in+0x7fb/0x890 [ax25]
  [&lt;c0320005&gt;] ? _spin_unlock_bh+0x25/0x30
  [&lt;f8d1bdf6&gt;] ax25_kiss_rcv+0x2c6/0x800 [ax25]
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c014a8a7&gt;] ? __lock_release+0x47/0x70
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c031ffdd&gt;] ? _read_unlock+0x1d/0x20
  [&lt;c02a4769&gt;] ? sock_def_readable+0x59/0x80
  [&lt;c02a4d3a&gt;] ? sock_queue_rcv_skb+0x13a/0x1d0
  [&lt;c02a4c45&gt;] ? sock_queue_rcv_skb+0x45/0x1d0
  [&lt;f8d1bb30&gt;] ? ax25_kiss_rcv+0x0/0x800 [ax25]
  [&lt;c02ac715&gt;] netif_receive_skb+0x255/0x2f0
  [&lt;c02ac5c0&gt;] ? netif_receive_skb+0x100/0x2f0
  [&lt;c02af05c&gt;] process_backlog+0x7c/0xf0
  [&lt;c02aeb0c&gt;] net_rx_action+0x16c/0x230
  [&lt;c02aea36&gt;] ? net_rx_action+0x96/0x230
  [&lt;c012bd53&gt;] __do_softirq+0x93/0x120
  [&lt;f8d2a68a&gt;] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c012be37&gt;] do_softirq+0x57/0x60
  [&lt;c012c265&gt;] local_bh_enable_ip+0xa5/0xe0
  [&lt;c0320005&gt;] _spin_unlock_bh+0x25/0x30
  [&lt;f8d2a68a&gt;] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
  [&lt;c025ea37&gt;] pty_write+0x47/0x60
  [&lt;c025c620&gt;] write_chan+0x1b0/0x220
  [&lt;c0259a1c&gt;] ? tty_write_lock+0x1c/0x50
  [&lt;c011fec0&gt;] ? default_wake_function+0x0/0x10
  [&lt;c0259bea&gt;] tty_write+0x12a/0x1c0
  [&lt;c025c470&gt;] ? write_chan+0x0/0x220
  [&lt;c018bbc6&gt;] vfs_write+0x96/0x130
  [&lt;c0259ac0&gt;] ? tty_write+0x0/0x1c0
  [&lt;c018c24d&gt;] sys_write+0x3d/0x70
  [&lt;c0104d1e&gt;] sysenter_past_esp+0x5f/0xa5
  =======================

Since rose_route_frame() does not use rose_node_list we can safely
remove rose_node_list_lock spin lock here and let it be free for
rose_get_neigh().

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rose: Socket lock was not released before returning to user space</title>
<updated>2008-04-20T01:41:51+00:00</updated>
<author>
<name>Bernard Pidoux</name>
<email>f6bvp@amsat.org</email>
</author>
<published>2008-04-20T01:41:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=43837b1e6c5aef803d57009a68db18df13e64892'/>
<id>43837b1e6c5aef803d57009a68db18df13e64892</id>
<content type='text'>
================================================
[ BUG: lock held when returning to user space! ]
------------------------------------------------
xfbbd/3683 is leaving the kernel with locks still held!
1 lock held by xfbbd/3683:
  #0:  (sk_lock-AF_ROSE){--..}, at: [&lt;c8cd1eb3&gt;] rose_connect+0x73/0x420 [rose]

INFO: task xfbbd:3683 blocked for more than 120 seconds.
"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
xfbbd         D 00000246     0  3683   3669
        c6965ee0 00000092 c02c5c40 00000246 c0f6b5f0 c0f6b5c0 c0f6b5f0 c0f6b5c0
        c0f6b614 c6965f18 c024b74b ffffffff c06ba070 00000000 00000000 00000001
        c6ab07c0 c012d450 c0f6b634 c0f6b634 c7b5bf10 c0d6004c c7b5bf10 c6965f40
Call Trace:
  [&lt;c024b74b&gt;] lock_sock_nested+0x6b/0xd0
  [&lt;c012d450&gt;] ? autoremove_wake_function+0x0/0x40
  [&lt;c02488f1&gt;] sock_fasync+0x41/0x150
  [&lt;c0249e69&gt;] sock_close+0x19/0x40
  [&lt;c0175d54&gt;] __fput+0xb4/0x170
  [&lt;c0176018&gt;] fput+0x18/0x20
  [&lt;c017300e&gt;] filp_close+0x3e/0x70
  [&lt;c01744e9&gt;] sys_close+0x69/0xb0
  [&lt;c0103bda&gt;] sysenter_past_esp+0x5f/0xa5
  =======================
INFO: lockdep is turned off.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&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>
================================================
[ BUG: lock held when returning to user space! ]
------------------------------------------------
xfbbd/3683 is leaving the kernel with locks still held!
1 lock held by xfbbd/3683:
  #0:  (sk_lock-AF_ROSE){--..}, at: [&lt;c8cd1eb3&gt;] rose_connect+0x73/0x420 [rose]

INFO: task xfbbd:3683 blocked for more than 120 seconds.
"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
xfbbd         D 00000246     0  3683   3669
        c6965ee0 00000092 c02c5c40 00000246 c0f6b5f0 c0f6b5c0 c0f6b5f0 c0f6b5c0
        c0f6b614 c6965f18 c024b74b ffffffff c06ba070 00000000 00000000 00000001
        c6ab07c0 c012d450 c0f6b634 c0f6b634 c7b5bf10 c0d6004c c7b5bf10 c6965f40
Call Trace:
  [&lt;c024b74b&gt;] lock_sock_nested+0x6b/0xd0
  [&lt;c012d450&gt;] ? autoremove_wake_function+0x0/0x40
  [&lt;c02488f1&gt;] sock_fasync+0x41/0x150
  [&lt;c0249e69&gt;] sock_close+0x19/0x40
  [&lt;c0175d54&gt;] __fput+0xb4/0x170
  [&lt;c0176018&gt;] fput+0x18/0x20
  [&lt;c017300e&gt;] filp_close+0x3e/0x70
  [&lt;c01744e9&gt;] sys_close+0x69/0xb0
  [&lt;c0103bda&gt;] sysenter_past_esp+0x5f/0xa5
  =======================
INFO: lockdep is turned off.

Signed-off-by: Bernard Pidoux &lt;f6bvp@amsat.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
