diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2018-05-01 14:23:56 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2018-08-31 11:38:31 +0300 |
commit | f60c9e591b058af18b45f8e222d7b40cf3c001cb (patch) | |
tree | 4465273fccf427772d5adf56fd035a75621ac7ad /drivers/net/wireless/intel/iwlwifi/pcie/tx.c | |
parent | 50f067b35684dbc5dfe81683c6e381e8eb7da3fb (diff) | |
download | linux-f60c9e591b058af18b45f8e222d7b40cf3c001cb.tar.bz2 |
iwlwifi: improve the flow when a NIC is disconnected
When the NIC is disconnected, we just can't do anything
besides seeking for help from the bus driver. Dumping the
device's memory is not necessary and just bloats the logs
with unusable data. Moreover, asking mac80211 to restart
the hardware is also useless. Bypass all this.
Also, use the STATUS_TRANS_DEAD status bit instead of a
bool inside the transport layer. The advantage of this is
that now, the transport and the op_mode can know what is the
situation and bypass the useless recovery steps mentioned
above.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/pcie/tx.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index d5aba9ebd84a..b89e976ecfcd 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c @@ -1189,8 +1189,8 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans, lockdep_assert_held(&trans_pcie->reg_lock); /* Make sure the NIC is still alive in the bus */ - if (trans_pcie->scheduled_for_removal) - return -EIO; + if (test_bit(STATUS_TRANS_DEAD, &trans->status)) + return -ENODEV; if (!(cmd->flags & CMD_SEND_IN_IDLE) && !trans_pcie->ref_cmd_in_flight) { @@ -1961,11 +1961,9 @@ cancel: int iwl_trans_pcie_send_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) { - struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); - /* Make sure the NIC is still alive in the bus */ - if (trans_pcie->scheduled_for_removal) - return -EIO; + if (test_bit(STATUS_TRANS_DEAD, &trans->status)) + return -ENODEV; if (!(cmd->flags & CMD_SEND_IN_RFKILL) && test_bit(STATUS_RFKILL_OPMODE, &trans->status)) { |