From 31ca09dd6becfd954098ca7ddb6c1e27b13fe5d7 Mon Sep 17 00:00:00 2001 From: Luciano Coelho Date: Mon, 22 Sep 2014 13:22:51 +0300 Subject: [PATCH] iwlwifi: mvm: hold the rtnl when resuming from a d3 test We use ieee80211_iter_keys() which requires the rtnl to be held. If we don't lock the rtnl, like we do when we suspend during a d3 test, we get the following splat: RTNL: assertion failed at net/mac80211/key.c (566) CPU: 1 PID: 26529 Comm: cat Tainted: G W O 3.10.29-dev #1 Hardware name: Dell Inc. Latitude E6430/0CPWYR, BIOS A09 12/13/2012 e7b15008 e7b15008 e68adc1c c168aa62 e68adc54 f91f20b6 f923700c f9236fd8 00000236 00000000 ece23874 00000000 f94941e0 00000000 e43b8e48 e7b15008 00000000 e8b69e78 e68adcc0 f9493ab9 e68adc68 00000000 e43b8e48 e7b15008 Call Trace: [] dump_stack+0x16/0x18 [] ieee80211_iter_keys+0x166/0x170 [mac80211] [] ? iwl_mvm_query_wakeup_reasons+0x5f0/0x5f0 [iwlmvm] [] iwl_mvm_setup_connection_keep.isra.5+0x99/0x1d0 [iwlmvm] [] ? cfg80211_report_wowlan_wakeup+0x308/0x510 [cfg80211] [] iwl_mvm_query_wakeup_reasons+0x3f5/0x5f0 [iwlmvm] [] ? init_object+0x3a/0x70 [] ? iwl_trans_pcie_d3_resume+0x1be/0x3a0 [iwlwifi] [] __iwl_mvm_resume+0x14a/0x180 [iwlmvm] [] iwl_mvm_d3_test_release+0x26/0xc0 [iwlmvm] [] __fput+0xad/0x210 [] ____fput+0xd/0x10 [] task_work_run+0x81/0xb0 [] do_exit+0x255/0xac0 [] ? dequeue_signal+0x31/0x1a0 [] do_group_exit+0x38/0xa0 [] ? trace_hardirqs_on+0xb/0x10 [] get_signal_to_deliver+0x1e1/0x8e0 [] ? try_to_del_timer_sync+0x42/0x60 [] ? try_to_del_timer_sync+0x60/0x60 [] ? schedule_timeout+0x102/0x2a0 [] do_signal+0x3a/0x8e0 [] ? __internal_add_timer+0xb0/0xb0 [] ? schedule_timeout_interruptible+0x1a/0x20 [] ? msleep_interruptible+0x39/0x40 [] ? iwl_mvm_d3_test_read+0x49/0x70 [iwlmvm] [] ? vfs_read+0x8c/0x160 [] ? SyS_fadvise64_64+0x15f/0x2b0 [] ? iwl_mvm_wowlan_program_keys+0x4a0/0x4a0 [iwlmvm] [] ? SyS_read+0x57/0xa0 [] do_notify_resume+0x6f/0xa0 [] work_notifysig+0x29/0x31 Fix this by hold the rtnl lock when calling __iwl_mvm_resume() in the d3 test wake up path. Signed-off-by: Luciano Coelho Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/d3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c index c17be0fb7283..5b269224f817 100644 --- a/drivers/net/wireless/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/iwlwifi/mvm/d3.c @@ -1741,7 +1741,9 @@ static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file) int remaining_time = 10; mvm->d3_test_active = false; + rtnl_lock(); __iwl_mvm_resume(mvm, true); + rtnl_unlock(); iwl_abort_notification_waits(&mvm->notif_wait); ieee80211_restart_hw(mvm->hw); -- 2.20.1