]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.28/iwlwifi-mvm-overwrite-skb-info-later.patch
fix up queue-5.15/mm-fix-race-between-__split_huge_pmd_locked-and-gup-.patch
[thirdparty/kernel/stable-queue.git] / releases / 4.9.28 / iwlwifi-mvm-overwrite-skb-info-later.patch
CommitLineData
b74db2ac
GKH
1From bd05a5bd6b11d7fd26a668de83c5cb996de05f8f Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Fri, 2 Dec 2016 09:57:40 +0100
4Subject: iwlwifi: mvm: overwrite skb info later
5
6From: Johannes Berg <johannes.berg@intel.com>
7
8commit bd05a5bd6b11d7fd26a668de83c5cb996de05f8f upstream.
9
10We don't really need clear the skb's status area nor store the
11dev_cmd into it until we really commit to the frame by handing
12it to the transport - defer those operations until just before
13we do that.
14
15This doesn't entirely fix the bug with frames not getting sent
16out after having been deferred due to DQA, because it doesn't
17restore the info->driver_data[0] place that was already set to
18zero (or another value) by the A-MSDU logic.
19
20Fixes: 24afba7690e4 ("iwlwifi: mvm: support bss dynamic alloc/dealloc of queues")
21Signed-off-by: Johannes Berg <johannes.berg@intel.com>
22Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25---
26 drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 20 +++++++++++++++-----
27 1 file changed, 15 insertions(+), 5 deletions(-)
28
29--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
30+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
31@@ -459,7 +459,6 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mv
32 struct ieee80211_sta *sta, u8 sta_id)
33 {
34 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
35- struct ieee80211_tx_info *skb_info = IEEE80211_SKB_CB(skb);
36 struct iwl_device_cmd *dev_cmd;
37 struct iwl_tx_cmd *tx_cmd;
38
39@@ -479,12 +478,18 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mv
40
41 iwl_mvm_set_tx_cmd_rate(mvm, tx_cmd, info, sta, hdr->frame_control);
42
43+ return dev_cmd;
44+}
45+
46+static void iwl_mvm_skb_prepare_status(struct sk_buff *skb,
47+ struct iwl_device_cmd *cmd)
48+{
49+ struct ieee80211_tx_info *skb_info = IEEE80211_SKB_CB(skb);
50+
51 memset(&skb_info->status, 0, sizeof(skb_info->status));
52 memset(skb_info->driver_data, 0, sizeof(skb_info->driver_data));
53
54- skb_info->driver_data[1] = dev_cmd;
55-
56- return dev_cmd;
57+ skb_info->driver_data[1] = cmd;
58 }
59
60 static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
61@@ -598,6 +603,9 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mv
62 if (!dev_cmd)
63 return -1;
64
65+ /* From now on, we cannot access info->control */
66+ iwl_mvm_skb_prepare_status(skb, dev_cmd);
67+
68 tx_cmd = (struct iwl_tx_cmd *)dev_cmd->payload;
69
70 /* Copy MAC header from skb into command buffer */
71@@ -908,7 +916,6 @@ static int iwl_mvm_tx_mpdu(struct iwl_mv
72 goto drop;
73
74 tx_cmd = (struct iwl_tx_cmd *)dev_cmd->payload;
75- /* From now on, we cannot access info->control */
76
77 /*
78 * we handle that entirely ourselves -- for uAPSD the firmware
79@@ -1015,6 +1022,9 @@ static int iwl_mvm_tx_mpdu(struct iwl_mv
80 IWL_DEBUG_TX(mvm, "TX to [%d|%d] Q:%d - seq: 0x%x\n", mvmsta->sta_id,
81 tid, txq_id, IEEE80211_SEQ_TO_SN(seq_number));
82
83+ /* From now on, we cannot access info->control */
84+ iwl_mvm_skb_prepare_status(skb, dev_cmd);
85+
86 if (iwl_trans_tx(mvm->trans, skb, dev_cmd, txq_id))
87 goto drop_unlock_sta;
88