Lines Matching +full:retain +full:- +full:state +full:- +full:shutdown
9 * Copyright(c) 2018 - 2020 Intel Corporation
23 * Copyright(c) 2018 - 2020 Intel Corporation
30 * * Redistributions of source code must retain the above copyright
53 #include "iwl-trans.h"
54 #include "iwl-prph.h"
55 #include "iwl-context-info.h"
56 #include "iwl-context-info-gen3.h"
62 * (e.g. after platform boot, or shutdown via iwl_pcie_apm_stop())
88 * wake device's PCI Express link L1a -> L0s in iwl_pcie_gen2_apm_init()
95 ret = iwl_finish_nic_init(trans, trans->trans_cfg); in iwl_pcie_gen2_apm_init()
99 set_bit(STATUS_DEVICE_ENABLED, &trans->status); in iwl_pcie_gen2_apm_init()
106 IWL_DEBUG_INFO(trans, "Stop card, put in low power state\n"); in iwl_pcie_gen2_apm_stop()
109 if (!test_bit(STATUS_DEVICE_ENABLED, &trans->status)) in iwl_pcie_gen2_apm_stop()
124 clear_bit(STATUS_DEVICE_ENABLED, &trans->status); in iwl_pcie_gen2_apm_stop()
133 * D0A* (powered-up Active) --> D0U* (Uninitialized) state. in iwl_pcie_gen2_apm_stop()
142 lockdep_assert_held(&trans_pcie->mutex); in _iwl_trans_pcie_gen2_stop_device()
144 if (trans_pcie->is_down) in _iwl_trans_pcie_gen2_stop_device()
147 trans_pcie->is_down = true; in _iwl_trans_pcie_gen2_stop_device()
162 if (test_and_clear_bit(STATUS_DEVICE_ENABLED, &trans->status)) { in _iwl_trans_pcie_gen2_stop_device()
170 if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) in _iwl_trans_pcie_gen2_stop_device()
179 /* Stop the device, and put it in low power state */ in _iwl_trans_pcie_gen2_stop_device()
185 * Upon stop, the IVAR table gets erased, so msi-x won't in _iwl_trans_pcie_gen2_stop_device()
186 * work. This causes a bug in RF-KILL flows, since the interrupt in _iwl_trans_pcie_gen2_stop_device()
198 * should be masked. Re-ACK all the interrupts here. in _iwl_trans_pcie_gen2_stop_device()
203 clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status); in _iwl_trans_pcie_gen2_stop_device()
204 clear_bit(STATUS_INT_ENABLED, &trans->status); in _iwl_trans_pcie_gen2_stop_device()
205 clear_bit(STATUS_TPOWER_PMI, &trans->status); in _iwl_trans_pcie_gen2_stop_device()
213 /* re-take ownership to prevent other users from stealing the device */ in _iwl_trans_pcie_gen2_stop_device()
222 mutex_lock(&trans_pcie->mutex); in iwl_trans_pcie_gen2_stop_device()
223 trans_pcie->opmode_down = true; in iwl_trans_pcie_gen2_stop_device()
224 was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status); in iwl_trans_pcie_gen2_stop_device()
227 mutex_unlock(&trans_pcie->mutex); in iwl_trans_pcie_gen2_stop_device()
234 trans->cfg->min_txq_size); in iwl_pcie_gen2_nic_init()
236 /* TODO: most of the logic can be removed in A0 - but not in Z0 */ in iwl_pcie_gen2_nic_init()
237 spin_lock(&trans_pcie->irq_lock); in iwl_pcie_gen2_nic_init()
239 spin_unlock(&trans_pcie->irq_lock); in iwl_pcie_gen2_nic_init()
241 iwl_op_mode_nic_config(trans->op_mode); in iwl_pcie_gen2_nic_init()
245 return -ENOMEM; in iwl_pcie_gen2_nic_init()
248 if (iwl_txq_gen2_init(trans, trans->txqs.cmd.q_id, queue_size)) in iwl_pcie_gen2_nic_init()
249 return -ENOMEM; in iwl_pcie_gen2_nic_init()
265 memset(trans->txqs.queue_stopped, 0, in iwl_trans_pcie_gen2_fw_alive()
266 sizeof(trans->txqs.queue_stopped)); in iwl_trans_pcie_gen2_fw_alive()
267 memset(trans->txqs.queue_used, 0, sizeof(trans->txqs.queue_used)); in iwl_trans_pcie_gen2_fw_alive()
275 * Re-enable all the interrupts, including the RF-Kill one, now that in iwl_trans_pcie_gen2_fw_alive()
279 mutex_lock(&trans_pcie->mutex); in iwl_trans_pcie_gen2_fw_alive()
281 mutex_unlock(&trans_pcie->mutex); in iwl_trans_pcie_gen2_fw_alive()
294 ret = -EIO; in iwl_trans_pcie_gen2_start_fw()
303 * We enabled the RF-Kill interrupt and the handler may very in iwl_trans_pcie_gen2_start_fw()
312 mutex_lock(&trans_pcie->mutex); in iwl_trans_pcie_gen2_start_fw()
317 ret = -ERFKILL; in iwl_trans_pcie_gen2_start_fw()
322 if (trans_pcie->is_down) { in iwl_trans_pcie_gen2_start_fw()
325 ret = -EIO; in iwl_trans_pcie_gen2_start_fw()
343 if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) in iwl_trans_pcie_gen2_start_fw()
350 /* re-check RF-Kill state since we may have missed the interrupt */ in iwl_trans_pcie_gen2_start_fw()
353 ret = -ERFKILL; in iwl_trans_pcie_gen2_start_fw()
356 mutex_unlock(&trans_pcie->mutex); in iwl_trans_pcie_gen2_start_fw()