Commit f5354c17 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

iwlwifi: force scan complete after timeout

If we do not get notification from hardware about scan complete, after
timeout do mac80211 scan completion anyway. This assure we end scan
in case of firmware hung.

Patch fix one of the causes of wdev_cleanup_work warning reported at
https://bugzilla.redhat.com/show_bug.cgi?id=593566Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Acked-by: default avatarWey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 02d8c14b
...@@ -2081,7 +2081,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -2081,7 +2081,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
{ {
struct iwl_priv *priv = hw->priv; struct iwl_priv *priv = hw->priv;
struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
bool scan_completed = false;
IWL_DEBUG_MAC80211(priv, "enter\n"); IWL_DEBUG_MAC80211(priv, "enter\n");
...@@ -2090,18 +2089,13 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -2090,18 +2089,13 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
WARN_ON(ctx->vif != vif); WARN_ON(ctx->vif != vif);
ctx->vif = NULL; ctx->vif = NULL;
iwl_scan_cancel_timeout(priv, 100); if (priv->scan_vif == vif)
iwl_scan_cancel_timeout(priv, 100);
iwl_set_mode(priv, vif); iwl_set_mode(priv, vif);
if (!ctx->always_active) if (!ctx->always_active)
ctx->is_active = false; ctx->is_active = false;
if (priv->scan_vif == vif) {
scan_completed = true;
priv->scan_vif = NULL;
priv->scan_request = NULL;
}
/* /*
* When removing the IBSS interface, overwrite the * When removing the IBSS interface, overwrite the
* BT traffic load with the stored one from the last * BT traffic load with the stored one from the last
...@@ -2115,9 +2109,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -2115,9 +2109,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
memset(priv->bssid, 0, ETH_ALEN); memset(priv->bssid, 0, ETH_ALEN);
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
if (scan_completed)
ieee80211_scan_completed(priv->hw, true);
IWL_DEBUG_MAC80211(priv, "leave\n"); IWL_DEBUG_MAC80211(priv, "leave\n");
} }
...@@ -2298,6 +2289,7 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw) ...@@ -2298,6 +2289,7 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
iwl_scan_cancel_timeout(priv, 100);
if (!iwl_is_ready_rf(priv)) { if (!iwl_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
...@@ -2307,7 +2299,6 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw) ...@@ -2307,7 +2299,6 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
/* we are restarting association process /* we are restarting association process
* clear RXON_FILTER_ASSOC_MSK bit * clear RXON_FILTER_ASSOC_MSK bit
*/ */
iwl_scan_cancel_timeout(priv, 100);
ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
iwlcore_commit_rxon(priv, ctx); iwlcore_commit_rxon(priv, ctx);
......
...@@ -106,6 +106,15 @@ static void iwl_complete_scan(struct iwl_priv *priv, bool aborted) ...@@ -106,6 +106,15 @@ static void iwl_complete_scan(struct iwl_priv *priv, bool aborted)
priv->scan_request = NULL; priv->scan_request = NULL;
} }
static void iwl_force_scan_end(struct iwl_priv *priv)
{
IWL_DEBUG_SCAN(priv, "Forcing scan end\n");
clear_bit(STATUS_SCANNING, &priv->status);
clear_bit(STATUS_SCAN_HW, &priv->status);
clear_bit(STATUS_SCAN_ABORTING, &priv->status);
iwl_complete_scan(priv, true);
}
static void iwl_do_scan_abort(struct iwl_priv *priv) static void iwl_do_scan_abort(struct iwl_priv *priv)
{ {
int ret; int ret;
...@@ -125,10 +134,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv) ...@@ -125,10 +134,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv)
ret = iwl_send_scan_abort(priv); ret = iwl_send_scan_abort(priv);
if (ret) { if (ret) {
IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret); IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret);
clear_bit(STATUS_SCANNING, &priv->status); iwl_force_scan_end(priv);
clear_bit(STATUS_SCAN_HW, &priv->status);
clear_bit(STATUS_SCAN_ABORTING, &priv->status);
iwl_complete_scan(priv, true);
} else } else
IWL_DEBUG_SCAN(priv, "Sucessfully send scan abort\n"); IWL_DEBUG_SCAN(priv, "Sucessfully send scan abort\n");
} }
...@@ -151,6 +157,7 @@ EXPORT_SYMBOL(iwl_scan_cancel); ...@@ -151,6 +157,7 @@ EXPORT_SYMBOL(iwl_scan_cancel);
*/ */
int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms) int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
{ {
int ret;
unsigned long timeout = jiffies + msecs_to_jiffies(ms); unsigned long timeout = jiffies + msecs_to_jiffies(ms);
lockdep_assert_held(&priv->mutex); lockdep_assert_held(&priv->mutex);
...@@ -165,7 +172,10 @@ int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms) ...@@ -165,7 +172,10 @@ int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
msleep(20); msleep(20);
} }
return test_bit(STATUS_SCAN_HW, &priv->status); ret = test_bit(STATUS_SCAN_HW, &priv->status);
if (ret)
iwl_force_scan_end(priv);
return ret;
} }
EXPORT_SYMBOL(iwl_scan_cancel_timeout); EXPORT_SYMBOL(iwl_scan_cancel_timeout);
......
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