From: "Guy, Wey-Yi" <wey-yi.w.guy@intel.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
"Chatre, Reinette" <reinette.chatre@intel.com>,
"John W. Linville" <linville@tuxdriver.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 08/14] iwlwifi: force scan complete after timeout
Date: Fri, 10 Sep 2010 08:53:04 -0700 [thread overview]
Message-ID: <1284133984.6054.18.camel@wwguy-ubuntu> (raw)
In-Reply-To: <1284128807-11436-9-git-send-email-sgruszka@redhat.com>
On Fri, 2010-09-10 at 07:26 -0700, Stanislaw Gruszka wrote:
> 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>
> ---
> drivers/net/wireless/iwlwifi/iwl-core.c | 15 +++------------
> 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 87a2e40..7c1819f 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-core.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-core.c
> @@ -2041,7 +2041,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
> {
> struct iwl_priv *priv = hw->priv;
> struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
> - bool scan_completed = false;
>
> IWL_DEBUG_MAC80211(priv, "enter\n");
>
> @@ -2050,15 +2049,10 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
> WARN_ON(ctx->vif != vif);
> 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);
>
> - if (priv->scan_vif == vif) {
> - scan_completed = true;
> - priv->scan_vif = NULL;
> - priv->scan_request = NULL;
> - }
> -
> /*
> * When removing the IBSS interface, overwrite the
> * BT traffic load with the stored one from the last
> @@ -2072,9 +2066,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
> memset(priv->bssid, 0, ETH_ALEN);
> mutex_unlock(&priv->mutex);
>
> - if (scan_completed)
> - ieee80211_scan_completed(priv->hw, true);
> -
> IWL_DEBUG_MAC80211(priv, "leave\n");
>
> }
> @@ -2255,6 +2246,7 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
>
> spin_unlock_irqrestore(&priv->lock, flags);
>
> + iwl_scan_cancel_timeout(priv, 100);
> if (!iwl_is_ready_rf(priv)) {
> IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
> mutex_unlock(&priv->mutex);
> @@ -2264,7 +2256,6 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
> /* we are restarting association process
> * clear RXON_FILTER_ASSOC_MSK bit
> */
> - iwl_scan_cancel_timeout(priv, 100);
> ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
> iwlcore_commit_rxon(priv, ctx);
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
> index e65a98d..ce605e0 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)
> 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)
> {
> int ret;
> @@ -125,10 +134,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv)
> ret = iwl_send_scan_abort(priv);
> if (ret) {
> IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret);
> - 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);
> + iwl_force_scan_end(priv);
> } else
> IWL_DEBUG_SCAN(priv, "Sucessfully send scan abort\n");
> }
> @@ -151,6 +157,7 @@ EXPORT_SYMBOL(iwl_scan_cancel);
> */
> int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
> {
> + int ret;
> unsigned long timeout = jiffies + msecs_to_jiffies(ms);
>
> lockdep_assert_held(&priv->mutex);
> @@ -165,7 +172,10 @@ int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
> 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);
>
next prev parent reply other threads:[~2010-09-10 15:54 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 14:26 [PATCH 0/14 v3] iwlwifi: rewrite iwl-scan.c to avoid race conditions Stanislaw Gruszka
2010-09-10 14:26 ` [PATCH 01/14] iwlwifi: remove unused conf variables Stanislaw Gruszka
2010-09-10 15:49 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 02/14] iwlwifi: unify scan start checks Stanislaw Gruszka
2010-09-10 15:49 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 03/14] iwlwifi: move scan completed flags handling Stanislaw Gruszka
2010-09-10 15:50 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 04/14] iwlwifi: cancel scan when down the device Stanislaw Gruszka
2010-09-10 15:50 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 05/14] iwlwifi: report scan completion when abort fail Stanislaw Gruszka
2010-09-10 15:51 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 06/14] iwlwifi: rework iwl_scan_cancel_timeout Stanislaw Gruszka
2010-09-10 15:52 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 07/14] iwlwifi: rewrite scan completion Stanislaw Gruszka
2010-09-10 15:52 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 08/14] iwlwifi: force scan complete after timeout Stanislaw Gruszka
2010-09-10 15:53 ` Guy, Wey-Yi [this message]
2010-09-10 14:26 ` [PATCH 09/14] iwlwifi: assure we complete scan in scan_abort and scan_check works Stanislaw Gruszka
2010-09-10 15:54 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 10/14] iwlwifi: do not force complete scan too early Stanislaw Gruszka
2010-09-10 15:54 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 11/14] mac80211: wait for scan work complete before restarting hw Stanislaw Gruszka
2010-09-10 15:55 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 12/14] iwlwifi: cleanup scan initiate check Stanislaw Gruszka
2010-09-10 15:55 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 13/14] iwlwifi: use IWL_DEBUG_SCAN for debug scanning Stanislaw Gruszka
2010-09-10 15:56 ` Guy, Wey-Yi
2010-09-10 14:26 ` [PATCH 14/14] iwlwifi: apply settings when finishing scan Stanislaw Gruszka
2010-09-10 15:56 ` Guy, Wey-Yi
-- strict thread matches above, loose matches on Subject: below --
2010-09-13 12:46 [PATCH 0/14 v4] iwlwifi: rewrite iwl-scan.c to avoid race conditions Stanislaw Gruszka
2010-09-13 12:46 ` [PATCH 08/14] iwlwifi: force scan complete after timeout Stanislaw Gruszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1284133984.6054.18.camel@wwguy-ubuntu \
--to=wey-yi.w.guy@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=reinette.chatre@intel.com \
--cc=sgruszka@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox