Subject: Re: Inconsistent lock state and possible irq lock inversion dependency detected in ax25.ko

From: Jarek Poplawski <[email-masked]>
Date: Wed, 28 Nov 2007 14:48:08 +0100

On 21-11-2007 23:13, Bernard Pidoux wrote:
...
> [ INFO: inconsistent lock state ]
> 
> The error seems to reside around ax25_disconnect+0x46/0xaf [ax25] that 
> is called when an AX25 connect timeout or a connection failure occurs.
> Connect timeout is probably activating
> ax25_std_heartbeat_expiry+0x19/0xd3 [ax25]
... 

Hi,

Could you try this patch? (2.6.23 or later - should be no difference)

Thanks,
Jarek P.

---

diff -Nurp linux-2.6.24-rc2-/net/ax25/ax25_subr.c linux-2.6.24-rc2+/net/ax25/ax25_subr.c
--- linux-2.6.24-rc2-/net/ax25/ax25_subr.c	2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.24-rc2+/net/ax25/ax25_subr.c	2007-11-28 11:51:12.000000000 +0100
@@ -279,6 +279,7 @@ void ax25_disconnect(ax25_cb *ax25, int 
 	ax25_link_failed(ax25, reason);
 
 	if (ax25->sk != NULL) {
+		local_bh_disable();
 		bh_lock_sock(ax25->sk);
 		ax25->sk->sk_state     = TCP_CLOSE;
 		ax25->sk->sk_err       = reason;
@@ -288,5 +289,6 @@ void ax25_disconnect(ax25_cb *ax25, int 
 			sock_set_flag(ax25->sk, SOCK_DEAD);
 		}
 		bh_unlock_sock(ax25->sk);
+		local_bh_enable();
 	}
 }