summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2024-03-19 17:59:09 +0200
committeriwlwifi publisher <>2024-04-17 13:39:53 +0000
commit1ade4d42d7b867a1a12863bd3c8df5932f3dbf5b (patch)
treebe3b62219a317478302d72ee0d882b743a9eaaa5
parentfb418288c1b448d9c641586e240e6e910e037289 (diff)
downloadbackport-iwlwifi-1ade4d42d7b867a1a12863bd3c8df5932f3dbf5b.tar.gz
[BUGFIX] wifi: iwlwifi: mvm: avoid toggling EMLSR TPT blocker
In case that EMLSR in not blocked by tpt, but it is blocked due to another reason, and a statistics notif arrived just after the MPDU counters was reset in iwl_mvm_count_mpdu, iwl_mvm_update_esr_mode_tpt will get counters with a value that is lower than the threshold, and will block EMLSR. Then after some traffic, iwl_mvm_count_mpdu will unblock it back, and so on. To avoid that, return from iwl_mvm_update_esr_mode_tpt if EMLSR is not active, this function is not supposed to run when not in EMLSR anyway. type=bugfix ticket=jira:WIFI-397378 fixes=If9eb946e929a39e10fe5f4638bc8bc3f8976edf1 Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Change-Id: I9b6a188b5ee93d8bbe0218533738c6d2c789f247 Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/100136 (cherry picked from commit 02a7d8b3f38e683dd87344afa81116ccf994ce7b) Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/100353 automatic-review: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> tested: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> Tested-by: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> x-iwlwifi-stack-dev: afbf95f497235847147fb03185d93dc60f0574c1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/rx.c15
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/sta.c14
-rw-r--r--versions2
3 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
index 0194e54e1b..7a6b2edb31 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
@@ -961,8 +961,7 @@ iwl_mvm_stat_iterator_all_links(struct iwl_mvm *mvm,
static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm)
{
struct ieee80211_vif *bss_vif = iwl_mvm_get_bss_vif(mvm);
- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(bss_vif);
- struct ieee80211_sta *ap_sta;
+ struct iwl_mvm_vif *mvmvif;
struct iwl_mvm_sta *mvmsta;
unsigned long total_tx = 0, total_rx = 0;
@@ -971,11 +970,12 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm)
if (!bss_vif)
return;
- ap_sta = iwl_mvm_vif_from_mac80211(bss_vif)->ap_sta;
- if (!ap_sta)
+ mvmvif = iwl_mvm_vif_from_mac80211(bss_vif);
+
+ if (!mvmvif->esr_active || !mvmvif->ap_sta)
return;
- mvmsta = iwl_mvm_sta_from_mac80211(ap_sta);
+ mvmsta = iwl_mvm_sta_from_mac80211(mvmvif->ap_sta);
/* We only count for the AP sta in a MLO connection */
if (!mvmsta->mpdu_counters)
return;
@@ -993,9 +993,8 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm)
* In EMLSR we have statistics every 5 seconds, so we can reset
* the counters upon every statistics notification.
*/
- if (mvmvif->esr_active)
- memset(mvmsta->mpdu_counters[q].per_link, 0,
- sizeof(mvmsta->mpdu_counters[q].per_link));
+ memset(mvmsta->mpdu_counters[q].per_link, 0,
+ sizeof(mvmsta->mpdu_counters[q].per_link));
spin_unlock_bh(&mvmsta->mpdu_counters[q].lock);
}
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 6ffeaabd1d..70964eb7a9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -4455,14 +4455,16 @@ void iwl_mvm_count_mpdu(struct iwl_mvm_sta *mvm_sta, u8 fw_sta_id, u32 count,
queue_counter = &mvm_sta->mpdu_counters[queue];
link_counter = &queue_counter->per_link[fw_link_id];
- spin_lock_bh(&queue_counter->lock);
-
/*
- * When not in EMLSR, the window is handled during counting,
- * when in EMLSR - in the statistics flow
+ * When not in EMLSR, the window and the decision to enter EMLSR are
+ * handled during counting, when in EMLSR - in the statistics flow
*/
- if (!mvmvif->esr_active &&
- time_is_before_jiffies(queue_counter->window_start +
+ if (mvmvif->esr_active)
+ return;
+
+ spin_lock_bh(&queue_counter->lock);
+
+ if (time_is_before_jiffies(queue_counter->window_start +
IWL_MVM_TPT_COUNT_WINDOW)) {
memset(queue_counter->per_link, 0,
sizeof(queue_counter->per_link));
diff --git a/versions b/versions
index 6c0d2618e8..38c67a0360 100644
--- a/versions
+++ b/versions
@@ -2,5 +2,5 @@ BACKPORTS_VERSION="(see git)"
BACKPORTED_KERNEL_VERSION="(see git)"
BACKPORTED_KERNEL_NAME="iwlwifi"
BACKPORTS_BUILD_TSTAMP=__DATE__ \" \" __TIME__
-BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:release/core87:12036:2cfc25d7"
+BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:release/core87:12037:afbf95f4"
BACKPORTS_BRANCH_TSTAMP="Apr 17 2024 13:11:40"