1 commit 59615b5f9d1323898ca94e88e595b5b04115076a
2 Author: Andrey Yurovsky <andrey@cozybit.com>
3 Date: Thu Jun 25 16:07:42 2009 -0700
5 mac80211: fix allocation in mesh_queue_preq
7 We allocate a PREQ queue node in mesh_queue_preq, however the allocation
8 may cause us to sleep. Use GFP_ATOMIC to prevent this.
10 [ 1869.126498] BUG: scheduling while atomic: ping/1859/0x10000100
11 [ 1869.127164] Modules linked in: ath5k mac80211 ath
12 [ 1869.128310] Pid: 1859, comm: ping Not tainted 2.6.30-wl #1
13 [ 1869.128754] Call Trace:
14 [ 1869.129293] [<c1023a2b>] __schedule_bug+0x48/0x4d
15 [ 1869.129866] [<c13b5533>] __schedule+0x77/0x67a
16 [ 1869.130544] [<c1026f2e>] ? release_console_sem+0x17d/0x185
17 [ 1869.131568] [<c807cf47>] ? mesh_queue_preq+0x2b/0x165 [mac80211]
18 [ 1869.132318] [<c13b5b3e>] schedule+0x8/0x1f
19 [ 1869.132807] [<c1023c12>] __cond_resched+0x16/0x2f
20 [ 1869.133478] [<c13b5bf0>] _cond_resched+0x27/0x32
21 [ 1869.134191] [<c108a370>] kmem_cache_alloc+0x1c/0xcf
22 [ 1869.134714] [<c10273ae>] ? printk+0x15/0x17
23 [ 1869.135670] [<c807cf47>] mesh_queue_preq+0x2b/0x165 [mac80211]
24 [ 1869.136731] [<c807d1f8>] mesh_nexthop_lookup+0xee/0x12d [mac80211]
25 [ 1869.138130] [<c807417e>] ieee80211_xmit+0xe6/0x2b2 [mac80211]
26 [ 1869.138935] [<c80be46d>] ? ath5k_hw_setup_rx_desc+0x0/0x66 [ath5k]
27 [ 1869.139831] [<c80c97bc>] ? ath5k_tasklet_rx+0xba/0x506 [ath5k]
28 [ 1869.140863] [<c8075191>] ieee80211_subif_start_xmit+0x6c9/0x6e4
30 [ 1869.141665] [<c105cf1c>] ? handle_level_irq+0x78/0x9d
31 [ 1869.142390] [<c12e3f93>] dev_hard_start_xmit+0x168/0x1c7
32 [ 1869.143092] [<c12f1f17>] __qdisc_run+0xe1/0x1b7
33 [ 1869.143612] [<c12e25ff>] qdisc_run+0x18/0x1a
34 [ 1869.144248] [<c12e62f4>] dev_queue_xmit+0x16a/0x25a
35 [ 1869.144785] [<c13b6dcc>] ? _read_unlock_bh+0xe/0x10
36 [ 1869.145465] [<c12eacdb>] neigh_resolve_output+0x19c/0x1c7
37 [ 1869.146182] [<c130e2da>] ? ip_finish_output+0x0/0x51
38 [ 1869.146697] [<c130e2a0>] ip_finish_output2+0x182/0x1bc
39 [ 1869.147358] [<c130e327>] ip_finish_output+0x4d/0x51
40 [ 1869.147863] [<c130e9d5>] ip_output+0x80/0x85
41 [ 1869.148515] [<c130cc49>] dst_output+0x9/0xb
42 [ 1869.149141] [<c130dec6>] ip_local_out+0x17/0x1a
43 [ 1869.149632] [<c130e0bc>] ip_push_pending_frames+0x1f3/0x255
44 [ 1869.150343] [<c13247ff>] raw_sendmsg+0x5e6/0x667
45 [ 1869.150883] [<c1033c55>] ? insert_work+0x6a/0x73
46 [ 1869.151834] [<c8071e00>] ?
47 ieee80211_invoke_rx_handlers+0x17da/0x1ae8 [mac80211]
48 [ 1869.152630] [<c132bd68>] inet_sendmsg+0x3b/0x48
49 [ 1869.153232] [<c12d7deb>] __sock_sendmsg+0x45/0x4e
50 [ 1869.153740] [<c12d8537>] sock_sendmsg+0xb8/0xce
51 [ 1869.154519] [<c80be46d>] ? ath5k_hw_setup_rx_desc+0x0/0x66 [ath5k]
52 [ 1869.155289] [<c1036b25>] ? autoremove_wake_function+0x0/0x30
53 [ 1869.155859] [<c115992b>] ? __copy_from_user_ll+0x11/0xce
54 [ 1869.156573] [<c1159d99>] ? copy_from_user+0x31/0x54
55 [ 1869.157235] [<c12df646>] ? verify_iovec+0x40/0x6e
56 [ 1869.157778] [<c12d869a>] sys_sendmsg+0x14d/0x1a5
57 [ 1869.158714] [<c8072c40>] ? __ieee80211_rx+0x49e/0x4ee [mac80211]
58 [ 1869.159641] [<c80c83fe>] ? ath5k_rxbuf_setup+0x6d/0x8d [ath5k]
59 [ 1869.160543] [<c80be46d>] ? ath5k_hw_setup_rx_desc+0x0/0x66 [ath5k]
60 [ 1869.161434] [<c80beba4>] ? ath5k_hw_get_rxdp+0xe/0x10 [ath5k]
61 [ 1869.162319] [<c80c97bc>] ? ath5k_tasklet_rx+0xba/0x506 [ath5k]
62 [ 1869.163063] [<c1005627>] ? enable_8259A_irq+0x40/0x43
63 [ 1869.163594] [<c101edb8>] ? __dequeue_entity+0x23/0x27
64 [ 1869.164793] [<c100187a>] ? __switch_to+0x2b/0x105
65 [ 1869.165442] [<c1021d5f>] ? finish_task_switch+0x5b/0x74
66 [ 1869.166129] [<c12d963a>] sys_socketcall+0x14b/0x17b
67 [ 1869.166612] [<c1002b95>] syscall_call+0x7/0xb
69 Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
70 Signed-off-by: John W. Linville <linville@tuxdriver.com>
72 diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
73 index 003cb47..f49ef28 100644
74 --- a/net/mac80211/mesh_hwmp.c
75 +++ b/net/mac80211/mesh_hwmp.c
76 @@ -637,7 +637,7 @@ static void mesh_queue_preq(struct mesh_path *mpath, u8 flags)
77 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
78 struct mesh_preq_queue *preq_node;
80 - preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_KERNEL);
81 + preq_node = kmalloc(sizeof(struct mesh_preq_queue), GFP_ATOMIC);
83 printk(KERN_DEBUG "Mesh HWMP: could not allocate PREQ node\n");