Return-path: Received: from wolverine02.qualcomm.com ([199.106.114.251]:24113 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755233AbaHFHcn (ORCPT ); Wed, 6 Aug 2014 03:32:43 -0400 From: Dedy Lansky To: "John W . Linville" CC: Vladimir Kondratiev , , Subject: [PATCH v2 12/13] wil6210: cfg80211_rx_mgmt to use GFP_ATOMIC Date: Wed, 6 Aug 2014 10:32:00 +0300 Message-ID: <1407310322-22568-13-git-send-email-qca_dlansky@qca.qualcomm.com> (sfid-20140806_095908_261612_6B05BF9A) In-Reply-To: <1407310322-22568-1-git-send-email-qca_dlansky@qca.qualcomm.com> References: <1407310322-22568-1-git-send-email-qca_dlansky@qca.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Vladimir Kondratiev 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 --- 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 596d6c1..1b64823 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); } } -- 1.8.5.2