aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/d3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/d3.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/d3.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index 1b1b2bf26819..4310cf102d78 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -1750,8 +1750,10 @@ static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm,
1750 int i, j, n_matches, ret; 1750 int i, j, n_matches, ret;
1751 1751
1752 fw_status = iwl_mvm_get_wakeup_status(mvm, vif); 1752 fw_status = iwl_mvm_get_wakeup_status(mvm, vif);
1753 if (!IS_ERR_OR_NULL(fw_status)) 1753 if (!IS_ERR_OR_NULL(fw_status)) {
1754 reasons = le32_to_cpu(fw_status->wakeup_reasons); 1754 reasons = le32_to_cpu(fw_status->wakeup_reasons);
1755 kfree(fw_status);
1756 }
1755 1757
1756 if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED) 1758 if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED)
1757 wakeup.rfkill_release = true; 1759 wakeup.rfkill_release = true;
@@ -1868,15 +1870,15 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
1868 /* get the BSS vif pointer again */ 1870 /* get the BSS vif pointer again */
1869 vif = iwl_mvm_get_bss_vif(mvm); 1871 vif = iwl_mvm_get_bss_vif(mvm);
1870 if (IS_ERR_OR_NULL(vif)) 1872 if (IS_ERR_OR_NULL(vif))
1871 goto out_unlock; 1873 goto err;
1872 1874
1873 ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test); 1875 ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test);
1874 if (ret) 1876 if (ret)
1875 goto out_unlock; 1877 goto err;
1876 1878
1877 if (d3_status != IWL_D3_STATUS_ALIVE) { 1879 if (d3_status != IWL_D3_STATUS_ALIVE) {
1878 IWL_INFO(mvm, "Device was reset during suspend\n"); 1880 IWL_INFO(mvm, "Device was reset during suspend\n");
1879 goto out_unlock; 1881 goto err;
1880 } 1882 }
1881 1883
1882 /* query SRAM first in case we want event logging */ 1884 /* query SRAM first in case we want event logging */
@@ -1902,7 +1904,8 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
1902 goto out_iterate; 1904 goto out_iterate;
1903 } 1905 }
1904 1906
1905 out_unlock: 1907err:
1908 iwl_mvm_free_nd(mvm);
1906 mutex_unlock(&mvm->mutex); 1909 mutex_unlock(&mvm->mutex);
1907 1910
1908out_iterate: 1911out_iterate:
@@ -1915,6 +1918,14 @@ out:
1915 /* return 1 to reconfigure the device */ 1918 /* return 1 to reconfigure the device */
1916 set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); 1919 set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);
1917 set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status); 1920 set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status);
1921
1922 /* We always return 1, which causes mac80211 to do a reconfig
1923 * with IEEE80211_RECONFIG_TYPE_RESTART. This type of
1924 * reconfig calls iwl_mvm_restart_complete(), where we unref
1925 * the IWL_MVM_REF_UCODE_DOWN, so we need to take the
1926 * reference here.
1927 */
1928 iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);
1918 return 1; 1929 return 1;
1919} 1930}
1920 1931
@@ -2021,7 +2032,6 @@ static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file)
2021 __iwl_mvm_resume(mvm, true); 2032 __iwl_mvm_resume(mvm, true);
2022 rtnl_unlock(); 2033 rtnl_unlock();
2023 iwl_abort_notification_waits(&mvm->notif_wait); 2034 iwl_abort_notification_waits(&mvm->notif_wait);
2024 iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN);
2025 ieee80211_restart_hw(mvm->hw); 2035 ieee80211_restart_hw(mvm->hw);
2026 2036
2027 /* wait for restart and disconnect all interfaces */ 2037 /* wait for restart and disconnect all interfaces */