diff options
author | Johannes Berg <johannes.berg@intel.com> | 2024-03-11 18:58:44 +0100 |
---|---|---|
committer | iwlwifi publisher <> | 2024-04-17 13:36:40 +0000 |
commit | 833d0f34de95d636330bc69f3c6ba36c3f0d966f (patch) | |
tree | 1c92f004850d6fafc3169dd9e11b1cf1bf941344 | |
parent | 5fd89396b40f8f2bc8292d933c8445cf24832985 (diff) | |
download | backport-iwlwifi-833d0f34de95d636330bc69f3c6ba36c3f0d966f.tar.gz |
[BUGFIX] wifi: iwlwifi: mvm: leave EMLSR before D3
With the call to iwl_mvm_block_esr() the flow won't really
leave EMLSR before actually suspending, since that only
calls ieee80211_set_active_links_async() internally, but
the worker cannot run as the suspend already holds the
wiphy mutex.
Fix that by explicitly calling ieee80211_set_active_links()
to leave EMLSR, and then doing iwl_mvm_block_esr() only for
consistency and to avoid re-entering it before ready after
resume.
Note that this also requires iwl_mvm_get_primary_link() to
be called without mvm->mutex held, but we can actually do
that as (since the prior change to set primary_link in the
correct place) the data it looks at is changed only with
both of the locks held. Change lockdep checks accordingly.
type=bugfix
fixes=I84233cb1c79ba538defafb8ddb983c47f04a400a
ticket=jira:WIFI-394785
Change-Id: Iae62d39b4eabbbb053fa9a59d283346241d69a07
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/98624
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>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/99154
Reviewed-by: Golan Ben Ami <golan.ben.ami@intel.com>
tested: Golan Ben Ami <golan.ben.ami@intel.com>
x-iwlwifi-stack-dev: c64ae1f7a421231b5b7978f7ea9152edc5afac14
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/link.c | 4 | ||||
-rw-r--r-- | versions | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index aa19ada3c3..1f6dd7cd00 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -1261,9 +1261,17 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, if (IS_ERR_OR_NULL(vif)) return 1; - mutex_lock(&mvm->mutex); - primary_link = iwl_mvm_get_primary_link(vif); + + /* leave ESR immediately, not only async with iwl_mvm_block_esr() */ + if (ieee80211_vif_is_mld(vif)) { + ret = ieee80211_set_active_links(vif, BIT(primary_link)); + if (ret) + return ret; + } + + mutex_lock(&mvm->mutex); + /* only additionally block for consistency and to avoid concurrency */ iwl_mvm_block_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_WOWLAN, primary_link); set_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index a25554fc4a..ed67b4d6d2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -856,7 +856,9 @@ u8 iwl_mvm_get_primary_link(struct ieee80211_vif *vif) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); - lockdep_assert_held(&mvmvif->mvm->mutex); + /* relevant data is written with both locks held, so read with either */ + lockdep_assert(lockdep_is_held(&mvmvif->mvm->mutex) || + lockdep_is_held(&mvmvif->mvm->hw->wiphy->mtx)); if (!ieee80211_vif_is_mld(vif)) return 0; @@ -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:12017:d08e7ad6" +BACKPORTS_GIT_TRACKED="iwlwifi-stack-public:release/core87:12018:c64ae1f7" BACKPORTS_BRANCH_TSTAMP="Apr 17 2024 13:11:40" |