aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2017-04-12 09:33:41 -0400
committerLuca Coelho <luciano.coelho@intel.com>2017-06-22 17:13:00 -0400
commitfcea37b2cf23f615252c424c217975f08da3c50d (patch)
treefd7578fe79e5c7108bd3a36748bd4b7935055462 /drivers/net/wireless/intel/iwlwifi/mvm/d3.c
parentf28b9361247360b64e0c6cf0bdd72ff5b5815a33 (diff)
iwlwifi: mvm: support D0I3_END_CMD at the start of resume
New FW versions require the D0I3_END_CMD to be sent as the first command to the FW in the resume flow. If the TLV is set, send that command first, otherwise keep the original behavior (i.e. send last). Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/d3.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/d3.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index f5b65c1ef42f..0028325fa22d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 Intel Deutschland GmbH 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as 13 * it under the terms of version 2 of the GNU General Public License as
@@ -34,7 +34,7 @@
34 * 34 *
35 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 35 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
36 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 36 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
37 * Copyright(c) 2016 Intel Deutschland GmbH 37 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
38 * All rights reserved. 38 * All rights reserved.
39 * 39 *
40 * Redistribution and use in source and binary forms, with or without 40 * Redistribution and use in source and binary forms, with or without
@@ -2075,6 +2075,8 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
2075 bool keep = false; 2075 bool keep = false;
2076 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa, 2076 bool unified_image = fw_has_capa(&mvm->fw->ucode_capa,
2077 IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG); 2077 IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG);
2078 bool d0i3_first = fw_has_capa(&mvm->fw->ucode_capa,
2079 IWL_UCODE_TLV_CAPA_D0I3_END_FIRST);
2078 2080
2079 mutex_lock(&mvm->mutex); 2081 mutex_lock(&mvm->mutex);
2080 2082
@@ -2095,6 +2097,15 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
2095 /* query SRAM first in case we want event logging */ 2097 /* query SRAM first in case we want event logging */
2096 iwl_mvm_read_d3_sram(mvm); 2098 iwl_mvm_read_d3_sram(mvm);
2097 2099
2100 if (d0i3_first) {
2101 ret = iwl_mvm_send_cmd_pdu(mvm, D0I3_END_CMD, 0, 0, NULL);
2102 if (ret < 0) {
2103 IWL_ERR(mvm, "Failed to send D0I3_END_CMD first (%d)\n",
2104 ret);
2105 goto err;
2106 }
2107 }
2108
2098 /* 2109 /*
2099 * Query the current location and source from the D3 firmware so we 2110 * Query the current location and source from the D3 firmware so we
2100 * can play it back when we re-intiailize the D0 firmware 2111 * can play it back when we re-intiailize the D0 firmware
@@ -2140,9 +2151,14 @@ out_iterate:
2140 iwl_mvm_d3_disconnect_iter, keep ? vif : NULL); 2151 iwl_mvm_d3_disconnect_iter, keep ? vif : NULL);
2141 2152
2142out: 2153out:
2154 /* no need to reset the device in unified images, if successful */
2143 if (unified_image && !ret) { 2155 if (unified_image && !ret) {
2156 /* nothing else to do if we already sent D0I3_END_CMD */
2157 if (d0i3_first)
2158 return 0;
2159
2144 ret = iwl_mvm_send_cmd_pdu(mvm, D0I3_END_CMD, 0, 0, NULL); 2160 ret = iwl_mvm_send_cmd_pdu(mvm, D0I3_END_CMD, 0, 0, NULL);
2145 if (!ret) /* D3 ended successfully - no need to reset device */ 2161 if (!ret)
2146 return 0; 2162 return 0;
2147 } 2163 }
2148 2164