diff options
author | Kalle Valo <kvalo@codeaurora.org> | 2017-07-21 07:33:27 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-07-21 07:33:27 -0400 |
commit | d755cbc26e8295ae8e5d30425364e093b4247a85 (patch) | |
tree | dfa8e03aa31b928b68ec6c22e4f20225c5d18132 | |
parent | 271612d72da5b46715447bc18add4a1cf7d87687 (diff) | |
parent | bf8b286f86fcc66d138fd992acfa37839340218d (diff) |
Merge tag 'iwlwifi-for-kalle-2017-07-21' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes
Some iwlwifi fixes for 4.13:
* A few NULL pointer dereferences in the recovery flow;
* A small but important fix for IBSS;
* A one-liner fix for tracing, which was including too much data;
* Some of these are bugzilla bug fixes;
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/dvm/tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 3 |
8 files changed, 34 insertions, 9 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/tx.c b/drivers/net/wireless/intel/iwlwifi/dvm/tx.c index adaa2f0097cc..fb40ddfced99 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/tx.c | |||
@@ -1189,11 +1189,11 @@ void iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb) | |||
1189 | next_reclaimed; | 1189 | next_reclaimed; |
1190 | IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n", | 1190 | IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n", |
1191 | next_reclaimed); | 1191 | next_reclaimed); |
1192 | iwlagn_check_ratid_empty(priv, sta_id, tid); | ||
1192 | } | 1193 | } |
1193 | 1194 | ||
1194 | iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); | 1195 | iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs); |
1195 | 1196 | ||
1196 | iwlagn_check_ratid_empty(priv, sta_id, tid); | ||
1197 | freed = 0; | 1197 | freed = 0; |
1198 | 1198 | ||
1199 | /* process frames */ | 1199 | /* process frames */ |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h index 545d14b0bc92..f5c1127253cb 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h | |||
@@ -55,8 +55,8 @@ static inline bool iwl_trace_data(struct sk_buff *skb) | |||
55 | /* also account for the RFC 1042 header, of course */ | 55 | /* also account for the RFC 1042 header, of course */ |
56 | offs += 6; | 56 | offs += 6; |
57 | 57 | ||
58 | return skb->len > offs + 2 && | 58 | return skb->len <= offs + 2 || |
59 | *(__be16 *)(skb->data + offs) == cpu_to_be16(ETH_P_PAE); | 59 | *(__be16 *)(skb->data + offs) != cpu_to_be16(ETH_P_PAE); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans, | 62 | static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans, |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index bcde1ba0f1c8..c7b1e58e3384 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
@@ -1084,7 +1084,13 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm) | |||
1084 | 1084 | ||
1085 | lockdep_assert_held(&mvm->mutex); | 1085 | lockdep_assert_held(&mvm->mutex); |
1086 | 1086 | ||
1087 | if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { | 1087 | if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status)) { |
1088 | /* | ||
1089 | * Now convert the HW_RESTART_REQUESTED flag to IN_HW_RESTART | ||
1090 | * so later code will - from now on - see that we're doing it. | ||
1091 | */ | ||
1092 | set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); | ||
1093 | clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); | ||
1088 | /* Clean up some internal and mac80211 state on restart */ | 1094 | /* Clean up some internal and mac80211 state on restart */ |
1089 | iwl_mvm_restart_cleanup(mvm); | 1095 | iwl_mvm_restart_cleanup(mvm); |
1090 | } else { | 1096 | } else { |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index eaacfaf37206..ddd8719f27b8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | |||
@@ -1090,6 +1090,7 @@ struct iwl_mvm { | |||
1090 | * @IWL_MVM_STATUS_HW_RFKILL: HW RF-kill is asserted | 1090 | * @IWL_MVM_STATUS_HW_RFKILL: HW RF-kill is asserted |
1091 | * @IWL_MVM_STATUS_HW_CTKILL: CT-kill is active | 1091 | * @IWL_MVM_STATUS_HW_CTKILL: CT-kill is active |
1092 | * @IWL_MVM_STATUS_ROC_RUNNING: remain-on-channel is running | 1092 | * @IWL_MVM_STATUS_ROC_RUNNING: remain-on-channel is running |
1093 | * @IWL_MVM_STATUS_HW_RESTART_REQUESTED: HW restart was requested | ||
1093 | * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active | 1094 | * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active |
1094 | * @IWL_MVM_STATUS_IN_D0I3: NIC is in D0i3 | 1095 | * @IWL_MVM_STATUS_IN_D0I3: NIC is in D0i3 |
1095 | * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running | 1096 | * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running |
@@ -1101,6 +1102,7 @@ enum iwl_mvm_status { | |||
1101 | IWL_MVM_STATUS_HW_RFKILL, | 1102 | IWL_MVM_STATUS_HW_RFKILL, |
1102 | IWL_MVM_STATUS_HW_CTKILL, | 1103 | IWL_MVM_STATUS_HW_CTKILL, |
1103 | IWL_MVM_STATUS_ROC_RUNNING, | 1104 | IWL_MVM_STATUS_ROC_RUNNING, |
1105 | IWL_MVM_STATUS_HW_RESTART_REQUESTED, | ||
1104 | IWL_MVM_STATUS_IN_HW_RESTART, | 1106 | IWL_MVM_STATUS_IN_HW_RESTART, |
1105 | IWL_MVM_STATUS_IN_D0I3, | 1107 | IWL_MVM_STATUS_IN_D0I3, |
1106 | IWL_MVM_STATUS_ROC_AUX_RUNNING, | 1108 | IWL_MVM_STATUS_ROC_AUX_RUNNING, |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 4d1188b8736a..9c175d5e9d67 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |||
@@ -1235,9 +1235,8 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error) | |||
1235 | */ | 1235 | */ |
1236 | if (!mvm->fw_restart && fw_error) { | 1236 | if (!mvm->fw_restart && fw_error) { |
1237 | iwl_mvm_fw_dbg_collect_desc(mvm, &iwl_mvm_dump_desc_assert, | 1237 | iwl_mvm_fw_dbg_collect_desc(mvm, &iwl_mvm_dump_desc_assert, |
1238 | NULL); | 1238 | NULL); |
1239 | } else if (test_and_set_bit(IWL_MVM_STATUS_IN_HW_RESTART, | 1239 | } else if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { |
1240 | &mvm->status)) { | ||
1241 | struct iwl_mvm_reprobe *reprobe; | 1240 | struct iwl_mvm_reprobe *reprobe; |
1242 | 1241 | ||
1243 | IWL_ERR(mvm, | 1242 | IWL_ERR(mvm, |
@@ -1268,6 +1267,7 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error) | |||
1268 | 1267 | ||
1269 | if (fw_error && mvm->fw_restart > 0) | 1268 | if (fw_error && mvm->fw_restart > 0) |
1270 | mvm->fw_restart--; | 1269 | mvm->fw_restart--; |
1270 | set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); | ||
1271 | ieee80211_restart_hw(mvm->hw); | 1271 | ieee80211_restart_hw(mvm->hw); |
1272 | } | 1272 | } |
1273 | } | 1273 | } |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 4df5f13fcdae..ab66b4394dfc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c | |||
@@ -277,6 +277,18 @@ static void iwl_mvm_rx_agg_session_expired(unsigned long data) | |||
277 | 277 | ||
278 | /* Timer expired */ | 278 | /* Timer expired */ |
279 | sta = rcu_dereference(ba_data->mvm->fw_id_to_mac_id[ba_data->sta_id]); | 279 | sta = rcu_dereference(ba_data->mvm->fw_id_to_mac_id[ba_data->sta_id]); |
280 | |||
281 | /* | ||
282 | * sta should be valid unless the following happens: | ||
283 | * The firmware asserts which triggers a reconfig flow, but | ||
284 | * the reconfig fails before we set the pointer to sta into | ||
285 | * the fw_id_to_mac_id pointer table. Mac80211 can't stop | ||
286 | * A-MDPU and hence the timer continues to run. Then, the | ||
287 | * timer expires and sta is NULL. | ||
288 | */ | ||
289 | if (!sta) | ||
290 | goto unlock; | ||
291 | |||
280 | mvm_sta = iwl_mvm_sta_from_mac80211(sta); | 292 | mvm_sta = iwl_mvm_sta_from_mac80211(sta); |
281 | ieee80211_stop_rx_ba_session_offl(mvm_sta->vif, | 293 | ieee80211_stop_rx_ba_session_offl(mvm_sta->vif, |
282 | sta->addr, ba_data->tid); | 294 | sta->addr, ba_data->tid); |
@@ -2015,7 +2027,8 @@ int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
2015 | IWL_MAX_TID_COUNT, | 2027 | IWL_MAX_TID_COUNT, |
2016 | wdg_timeout); | 2028 | wdg_timeout); |
2017 | 2029 | ||
2018 | if (vif->type == NL80211_IFTYPE_AP) | 2030 | if (vif->type == NL80211_IFTYPE_AP || |
2031 | vif->type == NL80211_IFTYPE_ADHOC) | ||
2019 | mvm->probe_queue = queue; | 2032 | mvm->probe_queue = queue; |
2020 | else if (vif->type == NL80211_IFTYPE_P2P_DEVICE) | 2033 | else if (vif->type == NL80211_IFTYPE_P2P_DEVICE) |
2021 | mvm->p2p_dev_queue = queue; | 2034 | mvm->p2p_dev_queue = queue; |
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index 92b3a55d0fbc..f95eec52508e 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c | |||
@@ -3150,7 +3150,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, | |||
3150 | init_waitqueue_head(&trans_pcie->d0i3_waitq); | 3150 | init_waitqueue_head(&trans_pcie->d0i3_waitq); |
3151 | 3151 | ||
3152 | if (trans_pcie->msix_enabled) { | 3152 | if (trans_pcie->msix_enabled) { |
3153 | if (iwl_pcie_init_msix_handler(pdev, trans_pcie)) | 3153 | ret = iwl_pcie_init_msix_handler(pdev, trans_pcie); |
3154 | if (ret) | ||
3154 | goto out_no_pci; | 3155 | goto out_no_pci; |
3155 | } else { | 3156 | } else { |
3156 | ret = iwl_pcie_alloc_ict(trans); | 3157 | ret = iwl_pcie_alloc_ict(trans); |
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index de50418adae5..034bdb4a0b06 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c | |||
@@ -298,6 +298,9 @@ void iwl_pcie_txq_check_wrptrs(struct iwl_trans *trans) | |||
298 | for (i = 0; i < trans->cfg->base_params->num_of_queues; i++) { | 298 | for (i = 0; i < trans->cfg->base_params->num_of_queues; i++) { |
299 | struct iwl_txq *txq = trans_pcie->txq[i]; | 299 | struct iwl_txq *txq = trans_pcie->txq[i]; |
300 | 300 | ||
301 | if (!test_bit(i, trans_pcie->queue_used)) | ||
302 | continue; | ||
303 | |||
301 | spin_lock_bh(&txq->lock); | 304 | spin_lock_bh(&txq->lock); |
302 | if (txq->need_update) { | 305 | if (txq->need_update) { |
303 | iwl_pcie_txq_inc_wr_ptr(trans, txq); | 306 | iwl_pcie_txq_inc_wr_ptr(trans, txq); |