From e8b616c68c0f72dd194a93f8860b3d72fb16faf5 Mon Sep 17 00:00:00 2001 From: Emmanuel Grumbach Date: Thu, 11 Feb 2016 19:37:14 +0200 Subject: [PATCH] [BUGFIX] iwlwifi: pcie: call iwl_trans_pcie_rf_kill under mutex [SQUASH] The patch below moved iwl_trans_pcie_rf_kill to a region that is not protected by the mutex which made lockdep complain. Fix that. type=bugfix bug=not-tracked fixes=I68148ae7249772535a55e7722fd16200dd7bb2f8 Change-Id: I999bc5cf195e624bc792f64e0778af766e0ac48b Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/pcie/trans.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 3086925..a0ddf75 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c @@ -1249,18 +1249,6 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, iwl_enable_rfkill_int(trans); - /* If platform's RF_KILL switch is NOT set to KILL */ - hw_rfkill = iwl_is_rfkill_set(trans); - if (hw_rfkill) - set_bit(STATUS_RFKILL, &trans->status); - else - clear_bit(STATUS_RFKILL, &trans->status); - iwl_trans_pcie_rf_kill(trans, hw_rfkill); - if (hw_rfkill && !run_in_rfkill) { - ret = -ERFKILL; - goto out; - } - iwl_write32(trans, CSR_INT, 0xFFFFFFFF); /* @@ -1275,6 +1263,18 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, mutex_lock(&trans_pcie->mutex); + /* If platform's RF_KILL switch is NOT set to KILL */ + hw_rfkill = iwl_is_rfkill_set(trans); + if (hw_rfkill) + set_bit(STATUS_RFKILL, &trans->status); + else + clear_bit(STATUS_RFKILL, &trans->status); + iwl_trans_pcie_rf_kill(trans, hw_rfkill); + if (hw_rfkill && !run_in_rfkill) { + ret = -ERFKILL; + goto out; + } + /* Someone called stop_device, don't try to start_fw */ if (trans_pcie->is_down) { IWL_WARN(trans, -- 2.5.0