linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images
  2016-10-19  7:27 [PATCH 0/7] iwlwifi: updates intended for v4.9 2016-10-19 Luca Coelho
@ 2016-10-19  7:27 ` Luca Coelho
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Coelho @ 2016-10-19  7:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, Luca Coelho

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

When a unified D0/D3 image is used, we don't restart the FW in the
D0->D3->D0 transitions.  Therefore, the d3_test functionality should
not call ieee8021_restart_hw() when the resuming either.

Fixes: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 4fdc3da..0e17cb2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -2271,7 +2271,8 @@ static void iwl_mvm_d3_test_disconn_work_iter(void *_data, u8 *mac,
 static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file)
 {
 	struct iwl_mvm *mvm = inode->i_private;
-	int remaining_time = 10;
+	bool unified_image = fw_has_capa(&mvm->fw->ucode_capa,
+					 IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG);
 
 	mvm->d3_test_active = false;
 
@@ -2282,17 +2283,21 @@ static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file)
 	mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
 
 	iwl_abort_notification_waits(&mvm->notif_wait);
-	ieee80211_restart_hw(mvm->hw);
+	if (!unified_image) {
+		int remaining_time = 10;
 
-	/* wait for restart and disconnect all interfaces */
-	while (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) &&
-	       remaining_time > 0) {
-		remaining_time--;
-		msleep(1000);
-	}
+		ieee80211_restart_hw(mvm->hw);
+
+		/* wait for restart and disconnect all interfaces */
+		while (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) &&
+		       remaining_time > 0) {
+			remaining_time--;
+			msleep(1000);
+		}
 
-	if (remaining_time == 0)
-		IWL_ERR(mvm, "Timed out waiting for HW restart to finish!\n");
+		if (remaining_time == 0)
+			IWL_ERR(mvm, "Timed out waiting for HW restart!\n");
+	}
 
 	ieee80211_iterate_active_interfaces_atomic(
 		mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images
       [not found] ` <20161019071122.18977-4-luca@coelho.fi>
@ 2016-10-26  6:19   ` Kalle Valo
  2016-10-26  6:47     ` Luca Coelho
  0 siblings, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2016-10-26  6:19 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless

Luca Coelho <luca@coelho.fi> writes:

> From: Luca Coelho <luciano.coelho@intel.com>
>
> When a unified D0/D3 image is used, we don't restart the FW in the
> D0->D3->D0 transitions.  Therefore, the d3_test functionality should
> not call ieee8021_restart_hw() when the resuming either.
>
> Fixes: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")

The word "commit" is not needed in the Fixes line, but no need to change
that now.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images
  2016-10-26  6:19   ` [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images Kalle Valo
@ 2016-10-26  6:47     ` Luca Coelho
  2016-10-26  6:59       ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Coelho @ 2016-10-26  6:47 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On Wed, 2016-10-26 at 09:19 +0300, Kalle Valo wrote:
> Luca Coelho <luca@coelho.fi> writes:
> 
> > From: Luca Coelho <luciano.coelho@intel.com>
> > 
> > When a unified D0/D3 image is used, we don't restart the FW in the
> > D0->D3->D0 transitions.  Therefore, the d3_test functionality should
> > not call ieee8021_restart_hw() when the resuming either.
> > 
> > Fixes: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")
> 
> The word "commit" is not needed in the Fixes line, but no need to change
> that now.

Oh, I didn't know that.  Thanks for pointing out.  I'll keep it in mind
for future patches.

--
Luca.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images
  2016-10-26  6:47     ` Luca Coelho
@ 2016-10-26  6:59       ` Kalle Valo
  2016-10-26  7:26         ` Luca Coelho
  0 siblings, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2016-10-26  6:59 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless

Luca Coelho <luca@coelho.fi> writes:

> On Wed, 2016-10-26 at 09:19 +0300, Kalle Valo wrote:
>> Luca Coelho <luca@coelho.fi> writes:
>> 
>> > From: Luca Coelho <luciano.coelho@intel.com>
>> > 
>> > When a unified D0/D3 image is used, we don't restart the FW in the
>> > D0->D3->D0 transitions.  Therefore, the d3_test functionality should
>> > not call ieee8021_restart_hw() when the resuming either.
>> > 
>> > Fixes: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")
>> 
>> The word "commit" is not needed in the Fixes line, but no need to change
>> that now.
>
> Oh, I didn't know that.  Thanks for pointing out.  I'll keep it in mind
> for future patches.

Related to this Documentation/SubmittingPatches has a handy tip:

----------------------------------------------------------------------
The following ``git config`` settings can be used to add a pretty format for
outputting the above style in the ``git log`` or ``git show`` commands::

        [core]
                abbrev = 12
        [pretty]
                fixes = Fixes: %h (\"%s\")
----------------------------------------------------------------------

And then you can do just:

$ git show --format=fixes 23ae61282b88 | head -1
Fixes: 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")
$

Perfect for a lazy person like me :)

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images
  2016-10-26  6:59       ` Kalle Valo
@ 2016-10-26  7:26         ` Luca Coelho
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Coelho @ 2016-10-26  7:26 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On Wed, 2016-10-26 at 09:59 +0300, Kalle Valo wrote:
> Luca Coelho <luca@coelho.fi> writes:
> 
> > On Wed, 2016-10-26 at 09:19 +0300, Kalle Valo wrote:
> > > Luca Coelho <luca@coelho.fi> writes:
> > > 
> > > > From: Luca Coelho <luciano.coelho@intel.com>
> > > > 
> > > > When a unified D0/D3 image is used, we don't restart the FW in the
> > > > D0->D3->D0 transitions.  Therefore, the d3_test functionality should
> > > > not call ieee8021_restart_hw() when the resuming either.
> > > > 
> > > > Fixes: commit 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")
> > > 
> > > The word "commit" is not needed in the Fixes line, but no need to change
> > > that now.
> > 
> > Oh, I didn't know that.  Thanks for pointing out.  I'll keep it in mind
> > for future patches.
> 
> Related to this Documentation/SubmittingPatches has a handy tip:
> 
> ----------------------------------------------------------------------
> The following ``git config`` settings can be used to add a pretty format for
> outputting the above style in the ``git log`` or ``git show`` commands::
> 
>         [core]
>                 abbrev = 12
>         [pretty]
>                 fixes = Fixes: %h (\"%s\")
> ----------------------------------------------------------------------
> 
> And then you can do just:
> 
> $ git show --format=fixes 23ae61282b88 | head -1
> Fixes: 23ae61282b88 ("iwlwifi: mvm: Do not switch to D3 image on suspend")
> $
> 
> Perfect for a lazy person like me :)

Wow, really perfect for me too! Thanks! I should read SubmittingPatches
more often. :)

--
Luca.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-26  7:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20161019071122.18977-1-luca@coelho.fi>
     [not found] ` <20161019071122.18977-4-luca@coelho.fi>
2016-10-26  6:19   ` [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images Kalle Valo
2016-10-26  6:47     ` Luca Coelho
2016-10-26  6:59       ` Kalle Valo
2016-10-26  7:26         ` Luca Coelho
2016-10-19  7:27 [PATCH 0/7] iwlwifi: updates intended for v4.9 2016-10-19 Luca Coelho
2016-10-19  7:27 ` [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images Luca Coelho

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).