linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-wireless@vger.kernel.org
Cc: Eliad Peller <eliad@wizery.com>,
	Eliad Peller <eliadx.peller@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 22/37] Revert "iwlwifi: mvm: move deferred d0i3 exit to resume_complete op"
Date: Tue,  4 Aug 2015 23:43:12 +0300	[thread overview]
Message-ID: <1438721007-23283-22-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <0BA3FCBA62E2DC44AF3030971E174FB32E7E11FA@hasmsx107.ger.corp.intel.com>

From: Eliad Peller <eliad@wizery.com>

This reverts commit 088070a2f6575402d3dd82e1c5a4a8e1941805f6.

When working in d0i3_on_idle mode, we explicitly go out
of d0i3 on resume (so other potential commands could
be sent).

However, D0I3_DEFER_WAKEUP is currently cleared on
resume complete (which happens only later on), causing
d0i3 exit to timeout.

Since mac80211 was modified to accept incoming frames
once drv_resume was called, we can safely revert this
patch, and handle the pending work on iwl_mvm_resume().

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/d3.c       | 58 +++++++++++++++++++++--------
 drivers/net/wireless/iwlwifi/mvm/mac80211.c | 13 -------
 2 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index 4165d10..246e60a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -1935,28 +1935,56 @@ out:
 	return 1;
 }
 
-int iwl_mvm_resume(struct ieee80211_hw *hw)
+static int iwl_mvm_resume_d3(struct iwl_mvm *mvm)
 {
-	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+	iwl_trans_resume(mvm->trans);
+
+	return __iwl_mvm_resume(mvm, false);
+}
+
+static int iwl_mvm_resume_d0i3(struct iwl_mvm *mvm)
+{
+	bool exit_now;
+
+	/*
+	 * make sure to clear D0I3_DEFER_WAKEUP before
+	 * calling iwl_trans_resume(), which might wait
+	 * for d0i3 exit completion.
+	 */
+	mutex_lock(&mvm->d0i3_suspend_mutex);
+	__clear_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags);
+	exit_now = __test_and_clear_bit(D0I3_PENDING_WAKEUP,
+					&mvm->d0i3_suspend_flags);
+	mutex_unlock(&mvm->d0i3_suspend_mutex);
+	if (exit_now) {
+		IWL_DEBUG_RPM(mvm, "Run deferred d0i3 exit\n");
+		_iwl_mvm_exit_d0i3(mvm);
+	}
 
 	iwl_trans_resume(mvm->trans);
 
-	if (mvm->hw->wiphy->wowlan_config->any) {
-		/* 'any' trigger means d0i3 usage */
-		if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND) {
-			int ret = iwl_mvm_exit_d0i3(hw->priv);
+	if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND) {
+		int ret = iwl_mvm_exit_d0i3(mvm->hw->priv);
 
-			if (ret)
-				return ret;
-			/*
-			 * d0i3 exit will be deferred until reconfig_complete.
-			 * make sure there we are out of d0i3.
-			 */
-		}
-		return 0;
+		if (ret)
+			return ret;
+		/*
+		 * d0i3 exit will be deferred until reconfig_complete.
+		 * make sure there we are out of d0i3.
+		 */
 	}
+	return 0;
+}
 
-	return __iwl_mvm_resume(mvm, false);
+int iwl_mvm_resume(struct ieee80211_hw *hw)
+{
+	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+
+	/* 'any' trigger means d0i3 was used */
+	if (hw->wiphy->wowlan_config->any)
+		return iwl_mvm_resume_d0i3(mvm);
+	else
+		return iwl_mvm_resume_d3(mvm);
 }
 
 void iwl_mvm_set_wakeup(struct ieee80211_hw *hw, bool enabled)
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index dfdab38..45e9913 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -1433,22 +1433,9 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm)
 
 static void iwl_mvm_resume_complete(struct iwl_mvm *mvm)
 {
-	bool exit_now;
-
 	if (!iwl_mvm_is_d0i3_supported(mvm))
 		return;
 
-	mutex_lock(&mvm->d0i3_suspend_mutex);
-	__clear_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags);
-	exit_now = __test_and_clear_bit(D0I3_PENDING_WAKEUP,
-					&mvm->d0i3_suspend_flags);
-	mutex_unlock(&mvm->d0i3_suspend_mutex);
-
-	if (exit_now) {
-		IWL_DEBUG_RPM(mvm, "Run deferred d0i3 exit\n");
-		_iwl_mvm_exit_d0i3(mvm);
-	}
-
 	if (mvm->trans->d0i3_mode == IWL_D0I3_MODE_ON_SUSPEND)
 		if (!wait_event_timeout(mvm->d0i3_exit_waitq,
 					!test_bit(IWL_MVM_STATUS_IN_D0I3,
-- 
2.1.4


  parent reply	other threads:[~2015-08-04 20:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 20:36 pull request: iwlwifi-next 2015-08-04 Grumbach, Emmanuel
2015-08-04 20:42 ` [PATCH 01/37] iwlwifi: mvm: rs: report last tx rate based on RSSI and caps Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 02/37] iwlwifi: mvm: handle RX MPDUs separately Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 03/37] iwlwifi: deprecate -10.ucode for 3160 / 7260 / 7265 Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 04/37] iwlwifi: dvm: start HW before running FW Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 05/37] iwlwifi: pcie: lock start_hw / start_fw / stop_device Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 06/37] iwlwifi: pcie: Set scheduler to work on auto mode Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 07/37] iwlwifi: mvm: LRU-assign key offsets Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 08/37] iwlwifi: dvm: move ADD_STA response handling to sync command Emmanuel Grumbach
2015-08-04 20:42 ` [PATCH 09/37] iwlwifi: dvm: remove ADD_STA prints relying on station ID Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 10/37] iwlwifi: dvm: remove command/return value from RX handlers Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 11/37] iwlwifi: mvm: " Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 12/37] iwlwifi: remove command and return value from opmode RX Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 13/37] iwlwifi: mvm: Do not sample the device time for session protection Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 14/37] iwlwifi: pcie: cancel Tx timer upon firmware crash Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 15/37] iwlwifi: pcie: add missing calls to synchronize_irq() Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 16/37] iwlwifi: pcie: don't warn on long MPDUs when supported Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 17/37] iwlwifi: remove command header flags field Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 18/37] iwlwifi: mvm: remove IWL_UCODE_TLV_API_BASIC_DWELL Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 19/37] iwlwifi: mvm: add basic Time of Flight (802.11mc FTM) support Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 20/37] iwlwifi: add wide firmware command infrastructure for TX Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 21/37] iwlwifi: mvm: move existing UMAC commands to group 1 Emmanuel Grumbach
2015-08-04 20:43 ` Emmanuel Grumbach [this message]
2015-08-04 20:43 ` [PATCH 23/37] iwlwifi: return error if d0i3 was aborted Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 24/37] iwlwifi: mvm: update comment of power_scheme module parameter Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 25/37] iwlwifi: mvm: Use the AP station for non_sta transmit Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 26/37] iwlwifi: pcie: provide a way to stop configuration if it is forbidden Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 27/37] iwlwifi: mvm: Enable Rx Checksum hw Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 28/37] iwlwifi: mvm: fix beacon filtering temperature thresholds for D0i3 Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 29/37] iwlwifi: mvm: ignore CQM when setting beacon filtering in D0i3 enter flow Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 30/37] iwlwifi: call d3_suspend/resume in d0i3 case as well Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 31/37] iwlwifi: pcie: reset write pointer on ict reset Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 32/37] iwlwifi: mvm: move TX PN assignment for CCMP to the driver Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 33/37] iwlwifi: make various functions void in the file rs.c Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 34/37] iwlwifi: add wide firmware command support for notifications Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 35/37] iwlwifi: mvm: add wide firmware command infrastructure for RX Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 36/37] iwlwifi: mvm: add wide firmware command support for debug triggers Emmanuel Grumbach
2015-08-04 20:43 ` [PATCH 37/37] iwlwifi: mvm: clean up fw-api-scan.h Emmanuel Grumbach
2015-08-06  7:31 ` pull request: iwlwifi-next 2015-08-04 Kalle Valo

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=1438721007-23283-22-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=eliad@wizery.com \
    --cc=eliadx.peller@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).