iwlwifi: mvm: handle async temperature notification with unlocked mutex
authorChaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Sun, 13 Mar 2016 09:39:53 +0000 (11:39 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 30 Mar 2016 13:21:20 +0000 (16:21 +0300)
Use RX_HANDLER_ASYNC_UNLOCKED instead of unlock and re-lock
the mutex independently.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
drivers/net/wireless/intel/iwlwifi/mvm/tt.c

index 46a22fd9f0d6910d34cf9b27c4fc15926ebead36..6153c8e86c53e71e480a9cf91f1b599a99ff4390 100644 (file)
@@ -292,7 +292,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
        RX_HANDLER(DTS_MEASUREMENT_NOTIFICATION, iwl_mvm_temp_notif,
                   RX_HANDLER_ASYNC_LOCKED),
        RX_HANDLER_GRP(PHY_OPS_GROUP, DTS_MEASUREMENT_NOTIF_WIDE,
-                      iwl_mvm_temp_notif, RX_HANDLER_ASYNC_LOCKED),
+                      iwl_mvm_temp_notif, RX_HANDLER_ASYNC_UNLOCKED),
        RX_HANDLER_GRP(PHY_OPS_GROUP, CT_KILL_NOTIFICATION,
                       iwl_mvm_ct_kill_notif, RX_HANDLER_SYNC),
 
index f1f28255a3a637a2653787cfb267a0c0a44cc43c..8d27137a928452bcb9bb8765035484e36cd1df54 100644 (file)
@@ -204,20 +204,11 @@ void iwl_mvm_temp_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
        if (WARN_ON(ths_crossed >= IWL_MAX_DTS_TRIPS))
                return;
 
-       /*
-        * We are now handling a temperature notification from the firmware
-        * in ASYNC and hold the mutex. thermal_notify_framework will call
-        * us back through get_temp() which ought to send a SYNC command to
-        * the firmware and hence to take the mutex.
-        * Avoid the deadlock by unlocking the mutex here.
-        */
        if (mvm->tz_device.tzone) {
                struct iwl_mvm_thermal_device *tz_dev = &mvm->tz_device;
 
-               mutex_unlock(&mvm->mutex);
                thermal_notify_framework(tz_dev->tzone,
                                         tz_dev->fw_trips_index[ths_crossed]);
-               mutex_lock(&mvm->mutex);
        }
 #endif /* CONFIG_THERMAL */
 }