[PATCH] libertas: fix spinlock recursion bug

Holger Schurig hs4233 at mail.mn-solutions.de
Wed Mar 26 11:27:50 EDT 2008

And yet another one:

libertas cmd: DNLD_CMD: command 0x001f, seq 21, size 16
BUG: spinlock recursion on CPU#0, lbs_main/1584
 lock: f7ce98d8, .magic: dead4ead, .owner: 
lbs_main/1584, .owner_cpu: 0
Pid: 1584, comm: lbs_main Not tainted 2.6.25-rc5-wl #19
 [<c01ccdb7>] spin_bug+0x76/0xb1
 [<c01ccecb>] _raw_spin_lock+0x34/0xc9
 [<c0306a73>] _spin_lock+0x13/0x15
 [<f884be4b>] if_cs_interrupt+0x96/0xb7 [libertas_cs]
 [<c0135d92>] handle_IRQ_event+0x21/0x48
 [<c0136fd5>] handle_level_irq+0x6f/0xba
 [<c010595a>] do_IRQ+0x53/0x6d
 [<c0104253>] common_interrupt+0x23/0x28
 [<c011bef5>] ? __do_softirq+0x2f/0x70
 [<c011bf5b>] do_softirq+0x25/0x2a
 [<c02b5ea4>] netif_rx_ni+0x24/0x3e
 [<f8af60e3>] lbs_process_rxed_packet+0x76b/0x7d8 [libertas]
 [<c02b024c>] ? __alloc_skb+0x4c/0xf8
 [<f884c096>] if_cs_get_int_status+0x22a/0x3d8 [libertas_cs]
 [<f8af10cd>] lbs_thread+0x2fe/0x745 [libertas]
 [<c0114edd>] ? default_wake_function+0x0/0xd
 [<f8af0dcf>] ? lbs_thread+0x0/0x745 [libertas]
 [<c0126f91>] kthread+0x39/0x60
 [<c0126f58>] ? kthread+0x0/0x60
 [<c01043c3>] kernel_thread_helper+0x7/0x10

So, in short: this is a rat's nest. So far I found 
and hope that it's giving me the knowledge I need. But I think 
that this point

    Avoid holding spinlock for more than 5 lines of code and
    across any function call (except accessors like readb).

from the mentioned web page is quite often violated inside 

More information about the libertas-dev mailing list