diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2016-10-05 04:24:12 -0400 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-10-19 01:44:11 -0400 |
commit | 85cd69b8f1f7e289fe931a82889e673fd0f04842 (patch) | |
tree | 59171b8c43cc4e67c795f9c3a007fd98a8f31f0c | |
parent | 276c4b4b74b6d5bc3cab35534409f3ad32464b78 (diff) |
iwlwifi: mvm: fix d3_test with unified D0/D3 images
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>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 25 |
1 files 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 4fdc3dad3e85..0e17cb238643 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, | |||
2271 | static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file) | 2271 | static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file) |
2272 | { | 2272 | { |
2273 | struct iwl_mvm *mvm = inode->i_private; | 2273 | struct iwl_mvm *mvm = inode->i_private; |
2274 | int remaining_time = 10; | 2274 | bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, |
2275 | IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG); | ||
2275 | 2276 | ||
2276 | mvm->d3_test_active = false; | 2277 | mvm->d3_test_active = false; |
2277 | 2278 | ||
@@ -2282,17 +2283,21 @@ static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file) | |||
2282 | mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; | 2283 | mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; |
2283 | 2284 | ||
2284 | iwl_abort_notification_waits(&mvm->notif_wait); | 2285 | iwl_abort_notification_waits(&mvm->notif_wait); |
2285 | ieee80211_restart_hw(mvm->hw); | 2286 | if (!unified_image) { |
2287 | int remaining_time = 10; | ||
2286 | 2288 | ||
2287 | /* wait for restart and disconnect all interfaces */ | 2289 | ieee80211_restart_hw(mvm->hw); |
2288 | while (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && | 2290 | |
2289 | remaining_time > 0) { | 2291 | /* wait for restart and disconnect all interfaces */ |
2290 | remaining_time--; | 2292 | while (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && |
2291 | msleep(1000); | 2293 | remaining_time > 0) { |
2292 | } | 2294 | remaining_time--; |
2295 | msleep(1000); | ||
2296 | } | ||
2293 | 2297 | ||
2294 | if (remaining_time == 0) | 2298 | if (remaining_time == 0) |
2295 | IWL_ERR(mvm, "Timed out waiting for HW restart to finish!\n"); | 2299 | IWL_ERR(mvm, "Timed out waiting for HW restart!\n"); |
2300 | } | ||
2296 | 2301 | ||
2297 | ieee80211_iterate_active_interfaces_atomic( | 2302 | ieee80211_iterate_active_interfaces_atomic( |
2298 | mvm->hw, IEEE80211_IFACE_ITER_NORMAL, | 2303 | mvm->hw, IEEE80211_IFACE_ITER_NORMAL, |