aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/pcie/tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/tx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/tx.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index 06952aadfd7b..5ef8044c2ea3 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -1039,18 +1039,14 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans,
1039 iwl_trans_pcie_ref(trans); 1039 iwl_trans_pcie_ref(trans);
1040 } 1040 }
1041 1041
1042 if (trans_pcie->cmd_in_flight)
1043 return 0;
1044
1045 trans_pcie->cmd_in_flight = true;
1046
1047 /* 1042 /*
1048 * wake up the NIC to make sure that the firmware will see the host 1043 * wake up the NIC to make sure that the firmware will see the host
1049 * command - we will let the NIC sleep once all the host commands 1044 * command - we will let the NIC sleep once all the host commands
1050 * returned. This needs to be done only on NICs that have 1045 * returned. This needs to be done only on NICs that have
1051 * apmg_wake_up_wa set. 1046 * apmg_wake_up_wa set.
1052 */ 1047 */
1053 if (trans->cfg->base_params->apmg_wake_up_wa) { 1048 if (trans->cfg->base_params->apmg_wake_up_wa &&
1049 !trans_pcie->cmd_hold_nic_awake) {
1054 __iwl_trans_pcie_set_bit(trans, CSR_GP_CNTRL, 1050 __iwl_trans_pcie_set_bit(trans, CSR_GP_CNTRL,
1055 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 1051 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
1056 if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) 1052 if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000)
@@ -1064,10 +1060,10 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans,
1064 if (ret < 0) { 1060 if (ret < 0) {
1065 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL, 1061 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
1066 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 1062 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
1067 trans_pcie->cmd_in_flight = false;
1068 IWL_ERR(trans, "Failed to wake NIC for hcmd\n"); 1063 IWL_ERR(trans, "Failed to wake NIC for hcmd\n");
1069 return -EIO; 1064 return -EIO;
1070 } 1065 }
1066 trans_pcie->cmd_hold_nic_awake = true;
1071 } 1067 }
1072 1068
1073 return 0; 1069 return 0;
@@ -1085,15 +1081,14 @@ static int iwl_pcie_clear_cmd_in_flight(struct iwl_trans *trans)
1085 iwl_trans_pcie_unref(trans); 1081 iwl_trans_pcie_unref(trans);
1086 } 1082 }
1087 1083
1088 if (WARN_ON(!trans_pcie->cmd_in_flight)) 1084 if (trans->cfg->base_params->apmg_wake_up_wa) {
1089 return 0; 1085 if (WARN_ON(!trans_pcie->cmd_hold_nic_awake))
1090 1086 return 0;
1091 trans_pcie->cmd_in_flight = false;
1092 1087
1093 if (trans->cfg->base_params->apmg_wake_up_wa) 1088 trans_pcie->cmd_hold_nic_awake = false;
1094 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL, 1089 __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
1095 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 1090 CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
1096 1091 }
1097 return 0; 1092 return 0;
1098} 1093}
1099 1094