Commit 2ad739f
committed
evl/net: skb: fix inconsistent locking of recycling queue
Interrupts on/off mismatch when locking the recycling queue. At this
chance annotate some routines wrt the legit call context.
[ 39.474194] ================================
[ 39.474195] WARNING: inconsistent lock state
[ 39.474197] 6.1.54+ BUPT-OS#66 Not tainted
[ 39.474200] --------------------------------
[ 39.474201] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
[ 39.474203] eth0.rx/370 [HC1[0]:SC0[0]:HE0:SE1] takes:
[ 39.474207] ffffffff8276b8d8 (recycling_lock){?.+.}-{0:0}, at: free_skb_inband+0x5/0xa0
[ 39.474222] {HARDIRQ-ON-W} state was registered at:
[ 39.474223] __lock_acquire+0x363/0x9a0
[ 39.474229] lock_acquire+0xbe/0x2a0
[ 39.474233] free_skb_inband+0x2a/0xa0
[ 39.474236] evl_net_free_skb+0x11/0x90
[ 39.474239] evl_net_do_rx+0x1b7/0x280
[ 39.474242] kthread_trampoline+0x1c7/0x2d0
[ 39.474246] kthread+0xf5/0x120
[ 39.474251] ret_from_fork+0x22/0x30
[ 39.474255] irq event stamp: 24
[ 39.474256] hardirqs last enabled at (23): [<ffffffff81b06125>] _raw_spin_unlock_irqrestore+0x65/0x80
[ 39.474262] hardirqs last disabled at (24): [<ffffffff81afb971>] __schedule+0x3a1/0x770
[ 39.474266] softirqs last enabled at (0): [<ffffffff810c1ad6>] copy_process+0x796/0x18c0
[ 39.474271] softirqs last disabled at (0): [<0000000000000000>] 0x0
[ 39.474274]
[ 39.474274] other info that might help us debug this:
[ 39.474275] Possible unsafe locking scenario:
[ 39.474275]
[ 39.474276] CPU0
[ 39.474276] ----
[ 39.474277] lock(recycling_lock);
[ 39.474278] <Interrupt>
[ 39.474279] lock(recycling_lock);
[ 39.474280]
[ 39.474280] *** DEADLOCK ***
Signed-off-by: Philippe Gerum <rpm@xenomai.org>1 parent 1d7b1f3 commit 2ad739f
2 files changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | | - | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| |||
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
299 | | - | |
| 301 | + | |
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
| |||
0 commit comments