All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@kernel.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 07/12] iwlwifi: mvm: test roc running status bits before removing the sta
Date: Sun, 19 Dec 2021 12:18:15 +0200	[thread overview]
Message-ID: <iwlwifi.20211219121514.d5376ac6bcb0.Ic5f8470ea60c072bde9d1503e5f528b65e301e20@changeid> (raw)
In-Reply-To: <20211219101820.85153-1-luca@coelho.fi>

From: Nathan Errera <nathan.errera@intel.com>

In some cases the sta is being removed twice since we do not test the
roc aux running before removing it. Start looking at the bit before
removing the sta.

Signed-off-by: Nathan Errera <nathan.errera@intel.com>
Fixes: 2c2c3647cde4 ("iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../net/wireless/intel/iwlwifi/mvm/time-event.c   | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
index e6813317edf3..b8c645b9880f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
@@ -49,14 +49,13 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)
 	struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, roc_done_wk);
 
 	/*
-	 * Clear the ROC_RUNNING /ROC_AUX_RUNNING status bit.
+	 * Clear the ROC_RUNNING status bit.
 	 * This will cause the TX path to drop offchannel transmissions.
 	 * That would also be done by mac80211, but it is racy, in particular
 	 * in the case that the time event actually completed in the firmware
 	 * (which is handled in iwl_mvm_te_handle_notif).
 	 */
 	clear_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status);
-	clear_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status);
 
 	synchronize_net();
 
@@ -82,9 +81,19 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)
 			mvmvif = iwl_mvm_vif_from_mac80211(mvm->p2p_device_vif);
 			iwl_mvm_flush_sta(mvm, &mvmvif->bcast_sta, true);
 		}
-	} else {
+	}
+
+	/*
+	 * Clear the ROC_AUX_RUNNING status bit.
+	 * This will cause the TX path to drop offchannel transmissions.
+	 * That would also be done by mac80211, but it is racy, in particular
+	 * in the case that the time event actually completed in the firmware
+	 * (which is handled in iwl_mvm_te_handle_notif).
+	 */
+	if (test_and_clear_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) {
 		/* do the same in case of hot spot 2.0 */
 		iwl_mvm_flush_sta(mvm, &mvm->aux_sta, true);
+
 		/* In newer version of this command an aux station is added only
 		 * in cases of dedicated tx queue and need to be removed in end
 		 * of use */
-- 
2.34.1


  parent reply	other threads:[~2021-12-19 10:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-19 10:18 [PATCH 00/12] iwlwifi: updates intended for v5.17 2021-12-19 part 1 Luca Coelho
2021-12-19 10:18 ` [PATCH 01/12] iwlwifi: mvm: use a define for checksum flags mask Luca Coelho
2021-12-19 10:18 ` [PATCH 02/12] iwlwifi: mvm: handle RX checksum on Bz devices Luca Coelho
2021-12-19 10:18 ` [PATCH 03/12] iwlwifi: mvm: don't trust hardware queue number Luca Coelho
2021-12-19 10:18 ` [PATCH 04/12] iwlwifi: mvm: change old-SN drop threshold Luca Coelho
2021-12-19 10:18 ` [PATCH 05/12] iwlwifi: yoyo: support TLV-based firmware reset Luca Coelho
2021-12-19 10:18 ` [PATCH 06/12] iwlwifi: don't pass actual WGDS revision number in table_revision Luca Coelho
2021-12-19 10:18 ` Luca Coelho [this message]
2021-12-19 10:18 ` [PATCH 08/12] iwlwifi: mvm: Fix calculation of frame length Luca Coelho
2021-12-19 10:18 ` [PATCH 09/12] iwlwifi: bump FW API to 69 for AX devices Luca Coelho
2021-12-19 10:18 ` [PATCH 10/12] iwlwifi: mvm: always store the PPAG table as the latest version Luca Coelho
2021-12-19 10:18 ` [PATCH 11/12] iwlwifi: mvm: correctly set channel flags Luca Coelho
2021-12-19 10:18 ` [PATCH 12/12] iwlwifi: mvm: perform 6GHz passive scan after suspend Luca Coelho

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=iwlwifi.20211219121514.d5376ac6bcb0.Ic5f8470ea60c072bde9d1503e5f528b65e301e20@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.