Commit 3dd1cd2d authored by Johannes Berg's avatar Johannes Berg

iwlwifi: mvm: fix locking in iwl_mvm_bt_rssi_event()

This will deadlock due to commit 9f34783863bea806
("iwlwifi: mvm: Implement BT coex notifications"):

  =============================================
  [ INFO: possible recursive locking detected ]
  3.5.0 #10 Tainted: G        W  O
  ---------------------------------------------
  kworker/2:1/5214 is trying to acquire lock:
   (&mvm->mutex){+.+.+.}, at: [<ffffffffa03be23e>] iwl_mvm_bt_rssi_event+0x5e/0x210 [iwlmvm]

  but task is already holding lock:
   (&mvm->mutex){+.+.+.}, at: [<ffffffffa03ab2d9>] iwl_mvm_async_handlers_wk+0x49/0x120 [iwlmvm]

  other info that might help us debug this:
   Possible unsafe locking scenario:

         CPU0
         ----
    lock(&mvm->mutex);
    lock(&mvm->mutex);

   *** DEADLOCK ***

Change-Id: I9104f252b34676e2f7ffcd51166f95367e08a4d9
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Reviewed-on: https://gerrit.rds.intel.com/21887Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>

Conflicts:
	drivers/net/wireless/iwlwifi/mvm/bt-coex.c
parent 911222b5
...@@ -602,15 +602,15 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -602,15 +602,15 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
}; };
int ret; int ret;
mutex_lock(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
/* Rssi update while not associated ?! */ /* Rssi update while not associated ?! */
if (WARN_ON_ONCE(mvmvif->ap_sta_id == IWL_MVM_STATION_COUNT)) if (WARN_ON_ONCE(mvmvif->ap_sta_id == IWL_MVM_STATION_COUNT))
goto out_unlock; return;
/* No open connection - reports should be disabled */ /* No open connection - reports should be disabled */
if (!BT_MBOX_MSG(&mvm->last_bt_notif, 3, OPEN_CON_2)) if (!BT_MBOX_MSG(&mvm->last_bt_notif, 3, OPEN_CON_2))
goto out_unlock; return;
IWL_DEBUG_COEX(mvm, "RSSI for %pM is now %s\n", vif->bss_conf.bssid, IWL_DEBUG_COEX(mvm, "RSSI for %pM is now %s\n", vif->bss_conf.bssid,
rssi_event == RSSI_EVENT_HIGH ? "HIGH" : "LOW"); rssi_event == RSSI_EVENT_HIGH ? "HIGH" : "LOW");
...@@ -641,9 +641,6 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -641,9 +641,6 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
if (iwl_mvm_bt_udpate_ctrl_kill_msk(mvm, data.reduced_tx_power)) if (iwl_mvm_bt_udpate_ctrl_kill_msk(mvm, data.reduced_tx_power))
IWL_ERR(mvm, "Failed to update the ctrl_kill_msk\n"); IWL_ERR(mvm, "Failed to update the ctrl_kill_msk\n");
out_unlock:
mutex_unlock(&mvm->mutex);
} }
void iwl_mvm_bt_coex_vif_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif) void iwl_mvm_bt_coex_vif_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment