All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregory.greenman@intel.com
To: kvalo@kernel.org, johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Yedidya Benshimol <yedidya.ben.shimol@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 14/15] wifi: iwlwifi: mvm: iterate over interfaces after an assert in d3
Date: Tue,  6 Sep 2022 16:42:18 +0300	[thread overview]
Message-ID: <20220906161827.ad888cc6cd91.Ib56e416fce17df089edf76d22896430df5ebe080@changeid> (raw)
In-Reply-To: <20220906134219.365090-1-gregory.greenman@intel.com>

From: Yedidya Benshimol <yedidya.ben.shimol@intel.com>

In recent patches notifications based d3 resume flow was added,
and the resume flow was changed.

Currently, when resuming from d3 during which an assert was thrown,
the resume flow skips the iteration over active interfaces
preventing the sta to reconnect to the ap.

Perform the iteration in case an assert was thrown to fix it.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 012fe872d9aa..d8a67f391ab9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -2555,7 +2555,7 @@ static bool iwl_mvm_check_rt_status(struct iwl_mvm *mvm,
  *	1. The mutex is already held.
  *	2. The callee functions unlock the mutex.
  */
-static void
+static bool
 iwl_mvm_choose_query_wakeup_reasons(struct iwl_mvm *mvm,
 				    struct ieee80211_vif *vif,
 				    struct iwl_d3_data *d3_data)
@@ -2581,12 +2581,9 @@ iwl_mvm_choose_query_wakeup_reasons(struct iwl_mvm *mvm,
 			mvm->keep_vif = vif;
 #endif
 
-		if (!d3_data->test)
-			ieee80211_iterate_active_interfaces_mtx(mvm->hw,
-								IEEE80211_IFACE_ITER_NORMAL,
-								iwl_mvm_d3_disconnect_iter,
-								keep ? vif : NULL);
+		return keep;
 	}
+	return false;
 }
 
 #define IWL_WOWLAN_WAKEUP_REASON_HAS_WAKEUP_PKT (IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET | \
@@ -2863,6 +2860,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
 	bool d0i3_first = fw_has_capa(&mvm->fw->ucode_capa,
 				      IWL_UCODE_TLV_CAPA_D0I3_END_FIRST);
 	bool resume_notif_based = iwl_mvm_d3_resume_notif_based(mvm);
+	bool keep = false;
 
 	mutex_lock(&mvm->mutex);
 
@@ -2935,7 +2933,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
 	}
 
 query_wakeup_reasons:
-	iwl_mvm_choose_query_wakeup_reasons(mvm, vif, &d3_data);
+	keep = iwl_mvm_choose_query_wakeup_reasons(mvm, vif, &d3_data);
 	/* has unlocked the mutex, so skip that */
 	goto out;
 
@@ -2947,6 +2945,12 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
 	kfree(d3_data.status);
 	iwl_mvm_free_nd(mvm);
 
+	if (!d3_data.test && !mvm->net_detect)
+		ieee80211_iterate_active_interfaces_mtx(mvm->hw,
+							IEEE80211_IFACE_ITER_NORMAL,
+							iwl_mvm_d3_disconnect_iter,
+							keep ? vif : NULL);
+
 	clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
 
 	/* no need to reset the device in unified images, if successful */
-- 
2.35.3


  parent reply	other threads:[~2022-09-06 14:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 13:42 [PATCH 00/15] iwlwifi: updates intended for v6.0 gregory.greenman
2022-09-06 13:42 ` [PATCH 01/15] wifi: iwlwifi: pcie: add support for BZ devices gregory.greenman
2022-09-06 13:42 ` [PATCH 02/15] wifi: iwlwifi: mvm: fix typo in struct iwl_rx_no_data API gregory.greenman
2022-09-06 13:42 ` [PATCH 03/15] wifi: iwlwifi: mvm: rxmq: refactor mac80211 rx_status setting gregory.greenman
2022-09-06 13:42 ` [PATCH 04/15] wifi: iwlwifi: mvm: rxmq: further unify some VHT/HE code gregory.greenman
2022-09-06 13:42 ` [PATCH 05/15] wifi: iwlwifi: mvm: refactor iwl_mvm_set_sta_rate() a bit gregory.greenman
2022-09-06 13:42 ` [PATCH 06/15] wifi: iwlwifi: cfg: remove IWL_DEVICE_BZ_COMMON macro gregory.greenman
2022-09-06 13:42 ` [PATCH 07/15] wifi: iwlwifi: mvm: don't check D0I3 version gregory.greenman
2022-09-06 13:42 ` [PATCH 08/15] wifi: iwlwifi: mvm: Add support for wowlan info notification gregory.greenman
2022-09-06 13:42 ` [PATCH 09/15] wifi: iwlwifi: mvm: Add support for wowlan wake packet notification gregory.greenman
2022-09-06 13:42 ` [PATCH 10/15] wifi: iwlwifi: mvm: Add support for d3 end notification gregory.greenman
2022-09-06 13:42 ` [PATCH 11/15] wifi: iwlwifi: mvm: enable resume based on notifications gregory.greenman
2022-09-06 13:42 ` [PATCH 12/15] wifi: iwlwifi: mvm: Add handling for scan offload match info notification gregory.greenman
2022-09-06 13:42 ` [PATCH 13/15] wifi: iwlwifi: mvm: trigger resume flow before wait for notifications gregory.greenman
2022-09-06 13:42 ` gregory.greenman [this message]
2022-09-06 13:42 ` [PATCH 15/15] wifi: iwlwifi: mvm: d3: parse keys from wowlan info notification gregory.greenman
2022-09-06 13:48 ` [PATCH 00/15] iwlwifi: updates intended for v6.0 Greenman, Gregory

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=20220906161827.ad888cc6cd91.Ib56e416fce17df089edf76d22896430df5ebe080@changeid \
    --to=gregory.greenman@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=yedidya.ben.shimol@intel.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 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.