aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2016-05-03 05:18:33 -0400
committerLuca Coelho <luciano.coelho@intel.com>2016-07-05 17:33:07 -0400
commit69e046423ad71de625ac1b0f0f390d3b9727b8c9 (patch)
tree44d0dca7de152334772d447dd040710f68e597ad /drivers/net/wireless/intel/iwlwifi/mvm/scan.c
parentf43495fd5e37b2ef4a187974011ff439e6354053 (diff)
iwlwifi: mvm: change scan timeout to a delayed work
Some transports may sleep when writing to registers, which is done when calling iwl_force_nmi(). So we can't call iwl_force_nmi() in a timer context. To solve that, convert the scan timeout timer to a delayed work. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/scan.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/scan.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index 6f609dd5c222..fb25d9e41912 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -399,7 +399,7 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
399 ieee80211_scan_completed(mvm->hw, 399 ieee80211_scan_completed(mvm->hw,
400 scan_notif->status == IWL_SCAN_OFFLOAD_ABORTED); 400 scan_notif->status == IWL_SCAN_OFFLOAD_ABORTED);
401 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); 401 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
402 del_timer(&mvm->scan_timer); 402 cancel_delayed_work(&mvm->scan_timeout_dwork);
403 } else { 403 } else {
404 IWL_ERR(mvm, 404 IWL_ERR(mvm,
405 "got scan complete notification but no scan is running\n"); 405 "got scan complete notification but no scan is running\n");
@@ -1222,15 +1222,16 @@ static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type)
1222 return -EIO; 1222 return -EIO;
1223} 1223}
1224 1224
1225#define SCAN_TIMEOUT (16 * HZ) 1225#define SCAN_TIMEOUT 20000
1226 1226
1227void iwl_mvm_scan_timeout(unsigned long data) 1227void iwl_mvm_scan_timeout_wk(struct work_struct *work)
1228{ 1228{
1229 struct iwl_mvm *mvm = (struct iwl_mvm *)data; 1229 struct delayed_work *delayed_work = to_delayed_work(work);
1230 struct iwl_mvm *mvm = container_of(delayed_work, struct iwl_mvm,
1231 scan_timeout_dwork);
1230 1232
1231 IWL_ERR(mvm, "regular scan timed out\n"); 1233 IWL_ERR(mvm, "regular scan timed out\n");
1232 1234
1233 del_timer(&mvm->scan_timer);
1234 iwl_force_nmi(mvm->trans); 1235 iwl_force_nmi(mvm->trans);
1235} 1236}
1236 1237
@@ -1313,7 +1314,8 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1313 mvm->scan_status |= IWL_MVM_SCAN_REGULAR; 1314 mvm->scan_status |= IWL_MVM_SCAN_REGULAR;
1314 iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN); 1315 iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN);
1315 1316
1316 mod_timer(&mvm->scan_timer, jiffies + SCAN_TIMEOUT); 1317 queue_delayed_work(system_wq, &mvm->scan_timeout_dwork,
1318 msecs_to_jiffies(SCAN_TIMEOUT));
1317 1319
1318 return 0; 1320 return 0;
1319} 1321}
@@ -1432,7 +1434,7 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
1432 if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_REGULAR) { 1434 if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_REGULAR) {
1433 ieee80211_scan_completed(mvm->hw, aborted); 1435 ieee80211_scan_completed(mvm->hw, aborted);
1434 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); 1436 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
1435 del_timer(&mvm->scan_timer); 1437 cancel_delayed_work(&mvm->scan_timeout_dwork);
1436 } else if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_SCHED) { 1438 } else if (mvm->scan_uid_status[uid] == IWL_MVM_SCAN_SCHED) {
1437 ieee80211_sched_scan_stopped(mvm->hw); 1439 ieee80211_sched_scan_stopped(mvm->hw);
1438 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED; 1440 mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED;
@@ -1628,7 +1630,7 @@ out:
1628 * to release the scan reference here. 1630 * to release the scan reference here.
1629 */ 1631 */
1630 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); 1632 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
1631 del_timer(&mvm->scan_timer); 1633 cancel_delayed_work(&mvm->scan_timeout_dwork);
1632 if (notify) 1634 if (notify)
1633 ieee80211_scan_completed(mvm->hw, true); 1635 ieee80211_scan_completed(mvm->hw, true);
1634 } else if (notify) { 1636 } else if (notify) {