From 48e81a15fa40dce4553ae3156e170a2be9562fa9 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratiev Date: Wed, 6 Aug 2014 10:32:00 +0300 Subject: [PATCH] wil6210: cfg80211_rx_mgmt to use GFP_ATOMIC Internally, cfg80211_rx_mgmt() takes lock: spin_lock_bh(&wdev->mgmt_registrations_lock); and therefore one can't use it with GFP_KERNEL allocation flags. When called with GFP_KERNEL, "sleep while atomic" warning triggered: <3>[242645.446224] BUG: sleeping function called from invalid context at kernel/mm/slub.c:926 <3>[242645.455516] in_atomic(): 1, irqs_disabled(): 0, pid: 18881, name: kworker/u16:0 <6>[242645.462868] CPU: 0 PID: 18881 Comm: kworker/u16:0 Tainted: G O 3.10.40-g619a884-00001-g357fa9c #2 <6>[242645.463044] Workqueue: wil6210_wmi wmi_event_worker [wil6210] <6>[242645.463087] Call trace: <6>[242645.463157] [] dump_backtrace+0x0/0x144 <6>[242645.463205] [] show_stack+0x10/0x1c <6>[242645.463259] [] dump_stack+0x1c/0x28 <6>[242645.463313] [] __might_sleep+0xe0/0xf0 <6>[242645.463365] [] kmem_cache_alloc+0x48/0x1e4 <6>[242645.463414] [] __alloc_skb+0x48/0x164 <6>[242645.463466] [] nl80211_send_mgmt+0x4c/0x1dc <6>[242645.463511] [] cfg80211_rx_mgmt+0x1bc/0x25c <6>[242645.463647] [] wmi_evt_rx_mgmt+0x21c/0x23c [wil6210] <6>[242645.463783] [] wmi_event_worker+0x230/0x2f8 [wil6210] <6>[242645.463838] [] process_one_work+0x258/0x3d0 <6>[242645.463887] [] worker_thread+0x1f0/0x310 <6>[242645.463946] [] kthread+0xac/0xb8 Signed-off-by: Vladimir Kondratiev Signed-off-by: John W. Linville --- drivers/net/wireless/ath/wil6210/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 596d6c1e8583..1b64823544eb 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -355,7 +355,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len) } } else { cfg80211_rx_mgmt(wil->wdev, freq, signal, - (void *)rx_mgmt_frame, d_len, 0, GFP_KERNEL); + (void *)rx_mgmt_frame, d_len, 0, GFP_ATOMIC); } } -- 2.20.1