Skip to contentSkip to conversation

2.6.19-rc5: lockdep warnings starting irattach

PATCH In review Andrey Borzenkov 4 participants 5 messages Nov 18, 2006 – Nov 24, 2006 Networking

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I experimented with SyncCE; after starting IrDA I got this:

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ip_tables: (C) 2000-2006 Netfilter Core Team

=============================================
[ INFO: possible recursive locking detected ]
2.6.19-rc5-2avb #2
- ---------------------------------------------
pppd/26425 is trying to acquire lock:
(&hashbin->hb_spinlock){....}, at: [<dfdea87a>] irlmp_slsap_inuse+0x5a/0x170
[irda]

but task is already holding lock:
(&hashbin->hb_spinlock){....}, at: [<dfdea857>] irlmp_slsap_inuse+0x37/0x170
[irda]

other info that might help us debug this:
1 lock held by pppd/26425:
#0: (&hashbin->hb_spinlock){....}, at: [<dfdea857>]

irlmp_slsap_inuse+0x37/0x170 [irda]

stack backtrace:
 [<c010413c>] dump_trace+0x1cc/0x200
 [<c010418a>] show_trace_log_lvl+0x1a/0x30
 [<c01047f2>] show_trace+0x12/0x20
 [<c01048c9>] dump_stack+0x19/0x20
 [<c01346ca>] __lock_acquire+0x8fa/0xc20
 [<c0134d2d>] lock_acquire+0x5d/0x80
 [<c02a851c>] _spin_lock+0x2c/0x40
 [<dfdea87a>] irlmp_slsap_inuse+0x5a/0x170 [irda]
 [<dfdebab2>] irlmp_open_lsap+0x62/0x180 [irda]
 [<dfdf35d1>] irttp_open_tsap+0x181/0x230 [irda]
 [<dfdc0c3d>] ircomm_open_tsap+0x5d/0xa0 [ircomm]
 [<dfdc05d8>] ircomm_open+0xb8/0xd0 [ircomm]
 [<dfdd0477>] ircomm_tty_open+0x4f7/0x570 [ircomm_tty]
 [<c020bbe4>] tty_open+0x174/0x340
 [<c016bd69>] chrdev_open+0x89/0x170
 [<c0167bd6>] __dentry_open+0xa6/0x1d0
 [<c0167da5>] nameidata_to_filp+0x35/0x40
 [<c0167df9>] do_filp_open+0x49/0x50
 [<c0167e47>] do_sys_open+0x47/0xd0
 [<c0167f0c>] sys_open+0x1c/0x20
 [<c010307d>] sysenter_past_esp+0x56/0x8d
 [<b7f86410>] 0xb7f86410
 =======================

This apparently happens when irattach is run. Interface itself (irda0) is created as far as I can tell.

Please let me know if additional information is required.

- -andrey

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFXwbDR6LMutpd94wRAiUpAJwIK5hSusOwFUloh0jXOb5hk5iVwgCfX7Iq c5kRWItPWR9WGw4jORPd21k=
=oax8
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 33 lines · Andrey Borzenkov

=============================================
[ INFO: possible recursive locking detected ]
2.6.19-rc5-2avb #2
- ---------------------------------------------
pppd/26425 is trying to acquire lock:
(&hashbin->hb_spinlock){....}, at: [<dfdea87a>] irlmp_slsap_inuse+0x5a/0x170
[irda]

but task is already holding lock:
(&hashbin->hb_spinlock){....}, at: [<dfdea857>] irlmp_slsap_inuse+0x37/0x170
[irda]

other info that might help us debug this:
1 lock held by pppd/26425:
#0: (&hashbin->hb_spinlock){....}, at: [<dfdea857>]

irlmp_slsap_inuse+0x37/0x170 [irda]

stack backtrace:
 [<c010413c>] dump_trace+0x1cc/0x200
 [<c010418a>] show_trace_log_lvl+0x1a/0x30
 [<c01047f2>] show_trace+0x12/0x20
 [<c01048c9>] dump_stack+0x19/0x20
 [<c01346ca>] __lock_acquire+0x8fa/0xc20
 [<c0134d2d>] lock_acquire+0x5d/0x80
 [<c02a851c>] _spin_lock+0x2c/0x40
 [<dfdea87a>] irlmp_slsap_inuse+0x5a/0x170 [irda]
 [<dfdebab2>] irlmp_open_lsap+0x62/0x180 [irda]
 [<dfdf35d1>] irttp_open_tsap+0x181/0x230 [irda]
 [<dfdc0c3d>] ircomm_open_tsap+0x5d/0xa0 [ircomm]
 [<dfdc05d8>] ircomm_open+0xb8/0xd0 [ircomm]
 [<dfdd0477>] ircomm_tty_open+0x4f7/0x570 [ircomm_tty]
 [<c020bbe4>] tty_open+0x174/0x340
 [<c016bd69>] chrdev_open+0x89/0x170
Quoted 8 lines
 [<c0167bd6>] __dentry_open+0xa6/0x1d0
 [<c0167da5>] nameidata_to_filp+0x35/0x40
 [<c0167df9>] do_filp_open+0x49/0x50
 [<c0167e47>] do_sys_open+0x47/0xd0
 [<c0167f0c>] sys_open+0x1c/0x20
 [<c010307d>] sysenter_past_esp+0x56/0x8d
 [<b7f86410>] 0xb7f86410
 =======================

The comment at the nesting lock says:

/* Careful for priority inversions here !
* irlmp->links is never taken while another IrDA
* spinlock is held, so we are safe. Jean II */

So, under the assumption the author was right, it just needs a lockdep annotation.

(depends on patches in -mm for spin_lock_irqsave_nested())

---
 net/irda/irlmp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/irda/irlmp.c +1 -1
Index: linux-2.6-mm/net/irda/irlmp.c
===================================================================
@@ -1678,7 +1678,7 @@ static int irlmp_slsap_inuse(__u8 slsap_
 	 *  every IrLAP connection and check every LSAP associated with each
 	 *  the connection.
 	 */
-	spin_lock_irqsave(&irlmp->links->hb_spinlock, flags);
+	spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags, 1);
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	while (lap != NULL) {
 		IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;);
Acked-by
#2 lore raw
Quoted 6 lines · Peter Zijlstra

The comment at the nesting lock says:

/* Careful for priority inversions here !
* irlmp->links is never taken while another IrDA
* spinlock is held, so we are safe. Jean II */

Quoted 6 lines

So, under the assumption the author was right, it just needs a lockdep annotation.

(depends on patches in -mm for spin_lock_irqsave_nested())

Ingo

#3 lore raw

PATCH 1/1 lockdep: annotate irda warning

In reply to Andrey Borzenkov

(repost with slightly changed patch)

Quoted 33 lines · Andrey Borzenkov

=============================================
[ INFO: possible recursive locking detected ]
2.6.19-rc5-2avb #2
- ---------------------------------------------
pppd/26425 is trying to acquire lock:
(&hashbin->hb_spinlock){....}, at: [<dfdea87a>] irlmp_slsap_inuse+0x5a/0x170
[irda]

but task is already holding lock:
(&hashbin->hb_spinlock){....}, at: [<dfdea857>] irlmp_slsap_inuse+0x37/0x170
[irda]

other info that might help us debug this:
1 lock held by pppd/26425:
#0: (&hashbin->hb_spinlock){....}, at: [<dfdea857>]

irlmp_slsap_inuse+0x37/0x170 [irda]

stack backtrace:
 [<c010413c>] dump_trace+0x1cc/0x200
 [<c010418a>] show_trace_log_lvl+0x1a/0x30
 [<c01047f2>] show_trace+0x12/0x20
 [<c01048c9>] dump_stack+0x19/0x20
 [<c01346ca>] __lock_acquire+0x8fa/0xc20
 [<c0134d2d>] lock_acquire+0x5d/0x80
 [<c02a851c>] _spin_lock+0x2c/0x40
 [<dfdea87a>] irlmp_slsap_inuse+0x5a/0x170 [irda]
 [<dfdebab2>] irlmp_open_lsap+0x62/0x180 [irda]
 [<dfdf35d1>] irttp_open_tsap+0x181/0x230 [irda]
 [<dfdc0c3d>] ircomm_open_tsap+0x5d/0xa0 [ircomm]
 [<dfdc05d8>] ircomm_open+0xb8/0xd0 [ircomm]
 [<dfdd0477>] ircomm_tty_open+0x4f7/0x570 [ircomm_tty]
 [<c020bbe4>] tty_open+0x174/0x340
 [<c016bd69>] chrdev_open+0x89/0x170
Quoted 8 lines
 [<c0167bd6>] __dentry_open+0xa6/0x1d0
 [<c0167da5>] nameidata_to_filp+0x35/0x40
 [<c0167df9>] do_filp_open+0x49/0x50
 [<c0167e47>] do_sys_open+0x47/0xd0
 [<c0167f0c>] sys_open+0x1c/0x20
 [<c010307d>] sysenter_past_esp+0x56/0x8d
 [<b7f86410>] 0xb7f86410
 =======================

The comment at the nesting lock says:

/* Careful for priority inversions here !
* irlmp->links is never taken while another IrDA
* spinlock is held, so we are safe. Jean II */

So, under the assumption the author was right, it just needs a lockdep annotation.

(depends on patches in -mm for spin_lock_irqsave_nested())

---
 net/irda/irlmp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/irda/irlmp.c +2 -1
Index: linux-2.6-mm/net/irda/irlmp.c
===================================================================
@@ -1678,7 +1678,8 @@ static int irlmp_slsap_inuse(__u8 slsap_
 	 *  every IrLAP connection and check every LSAP associated with each
 	 *  the connection.
 	 */
-	spin_lock_irqsave(&irlmp->links->hb_spinlock, flags);
+	spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags,
+			SINGLE_DEPTH_NESTING);
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	while (lap != NULL) {
 		IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;);
#4 lore raw

Re: [PATCH] lockdep: annotate irda warning

Hi guys,

Quoted 16 lines · Peter Zijlstra

So, under the assumption the author was right, it just needs a lockdep annotation.

(depends on patches in -mm for spin_lock_irqsave_nested())

---
 net/irda/irlmp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6-mm/net/irda/irlmp.c
===================================================================

net/irda/irlmp.c static int irlmp_slsap_inuse(__u8 slsap_ · line 1685

Quoted 9 lines
net/irda/irlmp.c +2 -1
@@ -1678,7 +1678,8 @@ static int irlmp_slsap_inuse(__u8 slsap_
 	 *  every IrLAP connection and check every LSAP associated with each
 	 *  the connection.
 	 */
-	spin_lock_irqsave(&irlmp->links->hb_spinlock, flags);
+	spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags,
+			SINGLE_DEPTH_NESTING);
 	lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
 	while (lap != NULL) {
 		IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;);

This patch got pushed into mainline, while the spin_lock_irq_save_nested() patches are not there yet. It breaks IrDA as irlmp.c doesn't build. Linus, could you please revert the corresponding commit (700f9672c9a61c12334651a94d17ec04620e1976) unless you are planning to pull the spin_lock_irq_save_nested() patches soon from -mm ?
Thanks a lot in advance.

Cheers,
Samuel.