diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-09-13 08:46:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-14 16:13:26 -0400 |
commit | f5354c17dc29681c241f2774f3ef9478fb586673 (patch) | |
tree | 7960a2d0b24396b890c0a5d2412675c6513680de | |
parent | 02d8c14b590f583fd6e8c16fe779f845845effd9 (diff) |
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=593566
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 20 |
2 files changed, 18 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index c9c523b2883f..b04a4f81ee97 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2081,7 +2081,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, | |||
2081 | { | 2081 | { |
2082 | struct iwl_priv *priv = hw->priv; | 2082 | struct iwl_priv *priv = hw->priv; |
2083 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); | 2083 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); |
2084 | bool scan_completed = false; | ||
2085 | 2084 | ||
2086 | IWL_DEBUG_MAC80211(priv, "enter\n"); | 2085 | IWL_DEBUG_MAC80211(priv, "enter\n"); |
2087 | 2086 | ||
@@ -2090,18 +2089,13 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, | |||
2090 | WARN_ON(ctx->vif != vif); | 2089 | WARN_ON(ctx->vif != vif); |
2091 | ctx->vif = NULL; | 2090 | ctx->vif = NULL; |
2092 | 2091 | ||
2093 | iwl_scan_cancel_timeout(priv, 100); | 2092 | if (priv->scan_vif == vif) |
2093 | iwl_scan_cancel_timeout(priv, 100); | ||
2094 | iwl_set_mode(priv, vif); | 2094 | iwl_set_mode(priv, vif); |
2095 | 2095 | ||
2096 | if (!ctx->always_active) | 2096 | if (!ctx->always_active) |
2097 | ctx->is_active = false; | 2097 | ctx->is_active = false; |
2098 | 2098 | ||
2099 | if (priv->scan_vif == vif) { | ||
2100 | scan_completed = true; | ||
2101 | priv->scan_vif = NULL; | ||
2102 | priv->scan_request = NULL; | ||
2103 | } | ||
2104 | |||
2105 | /* | 2099 | /* |
2106 | * When removing the IBSS interface, overwrite the | 2100 | * When removing the IBSS interface, overwrite the |
2107 | * BT traffic load with the stored one from the last | 2101 | * BT traffic load with the stored one from the last |
@@ -2115,9 +2109,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, | |||
2115 | memset(priv->bssid, 0, ETH_ALEN); | 2109 | memset(priv->bssid, 0, ETH_ALEN); |
2116 | mutex_unlock(&priv->mutex); | 2110 | mutex_unlock(&priv->mutex); |
2117 | 2111 | ||
2118 | if (scan_completed) | ||
2119 | ieee80211_scan_completed(priv->hw, true); | ||
2120 | |||
2121 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2112 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2122 | 2113 | ||
2123 | } | 2114 | } |
@@ -2298,6 +2289,7 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw) | |||
2298 | 2289 | ||
2299 | spin_unlock_irqrestore(&priv->lock, flags); | 2290 | spin_unlock_irqrestore(&priv->lock, flags); |
2300 | 2291 | ||
2292 | iwl_scan_cancel_timeout(priv, 100); | ||
2301 | if (!iwl_is_ready_rf(priv)) { | 2293 | if (!iwl_is_ready_rf(priv)) { |
2302 | IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); | 2294 | IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); |
2303 | mutex_unlock(&priv->mutex); | 2295 | mutex_unlock(&priv->mutex); |
@@ -2307,7 +2299,6 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw) | |||
2307 | /* we are restarting association process | 2299 | /* we are restarting association process |
2308 | * clear RXON_FILTER_ASSOC_MSK bit | 2300 | * clear RXON_FILTER_ASSOC_MSK bit |
2309 | */ | 2301 | */ |
2310 | iwl_scan_cancel_timeout(priv, 100); | ||
2311 | ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 2302 | ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
2312 | iwlcore_commit_rxon(priv, ctx); | 2303 | iwlcore_commit_rxon(priv, ctx); |
2313 | 2304 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index e65a98d5d07f..ce605e0aadfe 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -106,6 +106,15 @@ static void iwl_complete_scan(struct iwl_priv *priv, bool aborted) | |||
106 | priv->scan_request = NULL; | 106 | priv->scan_request = NULL; |
107 | } | 107 | } |
108 | 108 | ||
109 | static void iwl_force_scan_end(struct iwl_priv *priv) | ||
110 | { | ||
111 | IWL_DEBUG_SCAN(priv, "Forcing scan end\n"); | ||
112 | clear_bit(STATUS_SCANNING, &priv->status); | ||
113 | clear_bit(STATUS_SCAN_HW, &priv->status); | ||
114 | clear_bit(STATUS_SCAN_ABORTING, &priv->status); | ||
115 | iwl_complete_scan(priv, true); | ||
116 | } | ||
117 | |||
109 | static void iwl_do_scan_abort(struct iwl_priv *priv) | 118 | static void iwl_do_scan_abort(struct iwl_priv *priv) |
110 | { | 119 | { |
111 | int ret; | 120 | int ret; |
@@ -125,10 +134,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv) | |||
125 | ret = iwl_send_scan_abort(priv); | 134 | ret = iwl_send_scan_abort(priv); |
126 | if (ret) { | 135 | if (ret) { |
127 | IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret); | 136 | IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret); |
128 | clear_bit(STATUS_SCANNING, &priv->status); | 137 | iwl_force_scan_end(priv); |
129 | clear_bit(STATUS_SCAN_HW, &priv->status); | ||
130 | clear_bit(STATUS_SCAN_ABORTING, &priv->status); | ||
131 | iwl_complete_scan(priv, true); | ||
132 | } else | 138 | } else |
133 | IWL_DEBUG_SCAN(priv, "Sucessfully send scan abort\n"); | 139 | IWL_DEBUG_SCAN(priv, "Sucessfully send scan abort\n"); |
134 | } | 140 | } |
@@ -151,6 +157,7 @@ EXPORT_SYMBOL(iwl_scan_cancel); | |||
151 | */ | 157 | */ |
152 | int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms) | 158 | int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms) |
153 | { | 159 | { |
160 | int ret; | ||
154 | unsigned long timeout = jiffies + msecs_to_jiffies(ms); | 161 | unsigned long timeout = jiffies + msecs_to_jiffies(ms); |
155 | 162 | ||
156 | lockdep_assert_held(&priv->mutex); | 163 | lockdep_assert_held(&priv->mutex); |
@@ -165,7 +172,10 @@ int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms) | |||
165 | msleep(20); | 172 | msleep(20); |
166 | } | 173 | } |
167 | 174 | ||
168 | return test_bit(STATUS_SCAN_HW, &priv->status); | 175 | ret = test_bit(STATUS_SCAN_HW, &priv->status); |
176 | if (ret) | ||
177 | iwl_force_scan_end(priv); | ||
178 | return ret; | ||
169 | } | 179 | } |
170 | EXPORT_SYMBOL(iwl_scan_cancel_timeout); | 180 | EXPORT_SYMBOL(iwl_scan_cancel_timeout); |
171 | 181 | ||