diff mbox series

[07/12] iwlwifi: mvm: don't skip mgmt tid when flushing all tids

Message ID 20191020085545.16407-6-luca@coelho.fi (mailing list archive)
State Accepted
Delegated to: Luca Coelho
Headers show
Series iwlwifi: updates intended for v5.5 2019-20 | expand

Commit Message

Luca Coelho Oct. 20, 2019, 8:55 a.m. UTC
From: Haim Dreyfuss <haim.dreyfuss@intel.com>

There are various of flows which require tids flushing
(disconnection, suspend, etc...).
Currently, when the driver instructs the FW to flush
he masks all the data tids(0-7).
However, the driver doesn't set the management tid (#15)
which cause the FW not to flush it.
When the FW tries to remove the mgmt queue he throws an assert
since it is not an empty queue.
instead of just set only the data tids set everything and let
the FW ignore the invalid tids.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c  | 3 ++-
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c       | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Kalle Valo Oct. 25, 2019, 8:04 a.m. UTC | #1
Luca Coelho <luca@coelho.fi> writes:

> From: Haim Dreyfuss <haim.dreyfuss@intel.com>
>
> There are various of flows which require tids flushing
> (disconnection, suspend, etc...).
> Currently, when the driver instructs the FW to flush
> he masks all the data tids(0-7).
> However, the driver doesn't set the management tid (#15)
> which cause the FW not to flush it.
> When the FW tries to remove the mgmt queue he throws an assert
> since it is not an empty queue.
> instead of just set only the data tids set everything and let
> the FW ignore the invalid tids.
>
> Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

[...]

> -		ret = iwl_mvm_flush_sta_tids(mvm, flush_arg, 0xFF, 0) ? : count;
> +		ret = iwl_mvm_flush_sta_tids(mvm, flush_arg, 0xFFFF, 0)

[...]

> -			iwl_mvm_flush_sta_tids(mvm, i, 0xFF, 0);
> +			iwl_mvm_flush_sta_tids(mvm, i, 0xFFFF, 0);

[...]

> -					      0xff | BIT(IWL_MGMT_TID), flags);
> +					      0xffff, flags);

If, instead of magic values, you had a proper define this would be a
simple change. Hint hint ;)

No need to change anything, but something to keep in mind.
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 754adc0146be..9970f61b9f9f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -148,7 +148,8 @@  static ssize_t iwl_dbgfs_tx_flush_write(struct iwl_mvm *mvm, char *buf,
 				    "FLUSHING all tids queues on sta_id = %d\n",
 				    flush_arg);
 		mutex_lock(&mvm->mutex);
-		ret = iwl_mvm_flush_sta_tids(mvm, flush_arg, 0xFF, 0) ? : count;
+		ret = iwl_mvm_flush_sta_tids(mvm, flush_arg, 0xFFFF, 0)
+			? : count;
 		mutex_unlock(&mvm->mutex);
 		return ret;
 	}
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index e879c02ca4db..e0ffc3cdd677 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -4644,7 +4644,7 @@  static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop)
 			continue;
 
 		if (drop)
-			iwl_mvm_flush_sta_tids(mvm, i, 0xFF, 0);
+			iwl_mvm_flush_sta_tids(mvm, i, 0xFFFF, 0);
 		else
 			iwl_mvm_wait_sta_queues_empty(mvm,
 					iwl_mvm_sta_from_mac80211(sta));
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index f4778a6a40b9..81a88a89ea74 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -2059,7 +2059,7 @@  int iwl_mvm_flush_sta(struct iwl_mvm *mvm, void *sta, bool internal, u32 flags)
 
 	if (iwl_mvm_has_new_tx_api(mvm))
 		return iwl_mvm_flush_sta_tids(mvm, mvm_sta->sta_id,
-					      0xff | BIT(IWL_MGMT_TID), flags);
+					      0xffff, flags);
 
 	if (internal)
 		return iwl_mvm_flush_tx_path(mvm, int_sta->tfd_queue_msk,