diff mbox

[01/21] iwlwifi: dvm: fix WoWLAN

Message ID 1452170861-10060-1-git-send-email-emmanuel.grumbach@intel.com
State Accepted
Delegated to: Kalle Valo
Headers show

Commit Message

Emmanuel Grumbach Jan. 7, 2016, 12:47 p.m. UTC
My commit below introduced a mutex in the transport to
prevent concurrent operations. To do so, it added a flag
(is_down) to make sure the transport is in the right state.
This uncoverred an bug that didn't cause any harm until
now: iwldvm calls stop_device and then starts the firmware
without calling start_hw in between. While this flow is
fine from the device configuration point of view (register,
etc...), it is now forbidden by the new is_down flag.
This led to this error to appear:
iwlwifi 0000:05:00.0: Can't start_fw since the HW hasn't been started
and the suspend would fail.

This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=109591

CC: <stable@vger.kernel.org> [4.3+]
Reported-by: Bogdan Bogush <bogdan.s.bogush@gmail.com>
Fixes=fa9f3281cbb1 ("iwlwifi: pcie: lock start_hw / start_fw / stop_device")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kalle Valo Jan. 7, 2016, 9:15 p.m. UTC | #1
Emmanuel Grumbach <emmanuel.grumbach@intel.com> writes:

> My commit below introduced a mutex in the transport to
> prevent concurrent operations. To do so, it added a flag
> (is_down) to make sure the transport is in the right state.
> This uncoverred an bug that didn't cause any harm until
> now: iwldvm calls stop_device and then starts the firmware
> without calling start_hw in between. While this flow is
> fine from the device configuration point of view (register,
> etc...), it is now forbidden by the new is_down flag.
> This led to this error to appear:
> iwlwifi 0000:05:00.0: Can't start_fw since the HW hasn't been started
> and the suspend would fail.
>
> This fixes:
> https://bugzilla.kernel.org/show_bug.cgi?id=109591
>
> CC: <stable@vger.kernel.org> [4.3+]
> Reported-by: Bogdan Bogush <bogdan.s.bogush@gmail.com>
> Fixes=fa9f3281cbb1 ("iwlwifi: pcie: lock start_hw / start_fw / stop_device")

No need to change this anymore, but this should be:

Fixes: fa9f3281cbb1 ("iwlwifi: pcie: lock start_hw / start_fw / stop_device")
Emmanuel Grumbach Jan. 8, 2016, 8:08 a.m. UTC | #2
On 01/07/2016 11:15 PM, Kalle Valo wrote:
> Emmanuel Grumbach <emmanuel.grumbach@intel.com> writes:
>
>> My commit below introduced a mutex in the transport to
>> prevent concurrent operations. To do so, it added a flag
>> (is_down) to make sure the transport is in the right state.
>> This uncoverred an bug that didn't cause any harm until
>> now: iwldvm calls stop_device and then starts the firmware
>> without calling start_hw in between. While this flow is
>> fine from the device configuration point of view (register,
>> etc...), it is now forbidden by the new is_down flag.
>> This led to this error to appear:
>> iwlwifi 0000:05:00.0: Can't start_fw since the HW hasn't been started
>> and the suspend would fail.
>>
>> This fixes:
>> https://bugzilla.kernel.org/show_bug.cgi?id=109591
>>
>> CC: <stable@vger.kernel.org> [4.3+]
>> Reported-by: Bogdan Bogush <bogdan.s.bogush@gmail.com>
>> Fixes=fa9f3281cbb1 ("iwlwifi: pcie: lock start_hw / start_fw / stop_device")
> No need to change this anymore, but this should be:
>
> Fixes: fa9f3281cbb1 ("iwlwifi: pcie: lock start_hw / start_fw / stop_device")
>
Added to my "do_no_screw_up_before_upstreaming.sh" script.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c
index bee1c03..fd409ad 100644
--- a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c
@@ -1154,6 +1154,9 @@  int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan)
 
 	priv->ucode_loaded = false;
 	iwl_trans_stop_device(priv->trans);
+	ret = iwl_trans_start_hw(priv->trans);
+	if (ret)
+		goto out;
 
 	priv->wowlan = true;
 
@@ -1247,6 +1250,7 @@  int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan)
 
 	ret = iwlagn_send_patterns(priv, wowlan);
  out:
+	iwl_trans_stop_device(priv->trans);
 	kfree(key_data.rsc_tsc);
 	return ret;
 }