diff mbox

[19/31] iwlwifi: mvm: don't iterate interfaces to disconnect in net-detect

Message ID 1425238304-498-19-git-send-email-emmanuel.grumbach@intel.com (mailing list archive)
State Not Applicable
Delegated to: Johannes Berg
Headers show

Commit Message

Emmanuel Grumbach March 1, 2015, 7:31 p.m. UTC
From: Luciano Coelho <luciano.coelho@intel.com>

We shouldn't call iwl_mvm_d3_disconnect_iter() on the running
interfaces when we are woken up due to net-detect, because it doesn't
make sense.  Additionally, this seems to set the
IEEE80211_SDATA_DISCONNECT_RESUME flag that will cause a disconnection
on the next resume (if a normal WoWLAN is used).

To solve this, skip the iteration loop when net-detect is set.

Reported-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/d3.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Julian Calaby March 1, 2015, 10:23 p.m. UTC | #1
Hi Emmanuel,

On Mon, Mar 2, 2015 at 6:31 AM, Emmanuel Grumbach
<emmanuel.grumbach@intel.com> wrote:
> From: Luciano Coelho <luciano.coelho@intel.com>
>
> We shouldn't call iwl_mvm_d3_disconnect_iter() on the running
> interfaces when we are woken up due to net-detect, because it doesn't
> make sense.  Additionally, this seems to set the
> IEEE80211_SDATA_DISCONNECT_RESUME flag that will cause a disconnection
> on the next resume (if a normal WoWLAN is used).
>
> To solve this, skip the iteration loop when net-detect is set.
>
> Reported-by: Samuel Tan <samueltan@chromium.org>
> Reviewed-by: Johannes Berg <johannes.berg@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Shouldn't this be signed off by Luciano too?

Thanks,
Emmanuel Grumbach March 2, 2015, 6:24 a.m. UTC | #2
On Mon, 2015-03-02 at 09:23 +1100, Julian Calaby wrote:
> Hi Emmanuel,

> 

> On Mon, Mar 2, 2015 at 6:31 AM, Emmanuel Grumbach

> <emmanuel.grumbach@intel.com> wrote:

> > From: Luciano Coelho <luciano.coelho@intel.com>

> >

> > We shouldn't call iwl_mvm_d3_disconnect_iter() on the running

> > interfaces when we are woken up due to net-detect, because it doesn't

> > make sense.  Additionally, this seems to set the

> > IEEE80211_SDATA_DISCONNECT_RESUME flag that will cause a disconnection

> > on the next resume (if a normal WoWLAN is used).

> >

> > To solve this, skip the iteration loop when net-detect is set.

> >

> > Reported-by: Samuel Tan <samueltan@chromium.org>

> > Reviewed-by: Johannes Berg <johannes.berg@intel.com>

> > Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

> 

> Shouldn't this be signed off by Luciano too?

> 


Right - I removed it by mistake while removing other unneeded stuff in
the same area. I updated the tree and the tag.
Thanks.

> Thanks,

>
diff mbox

Patch

diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index 14e8fd6..9bdfa95 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -1876,25 +1876,28 @@  static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
 
 	if (mvm->net_detect) {
 		iwl_mvm_query_netdetect_reasons(mvm, vif);
+		/* has unlocked the mutex, so skip that */
+		goto out;
 	} else {
 		keep = iwl_mvm_query_wakeup_reasons(mvm, vif);
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 		if (keep)
 			mvm->keep_vif = vif;
+		/* has unlocked the mutex, so skip that */
+		goto out_iterate;
 #endif
 	}
-	/* has unlocked the mutex, so skip that */
-	goto out;
 
  out_unlock:
 	mutex_unlock(&mvm->mutex);
 
- out:
+out_iterate:
 	if (!test)
 		ieee80211_iterate_active_interfaces_rtnl(mvm->hw,
 			IEEE80211_IFACE_ITER_NORMAL,
 			iwl_mvm_d3_disconnect_iter, keep ? vif : NULL);
 
+out:
 	/* return 1 to reconfigure the device */
 	set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);
 	set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status);