]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mt76: mt7915: use ieee80211_free_txskb to free tx skbs
authorFelix Fietkau <nbd@nbd.name>
Wed, 12 Aug 2020 14:49:43 +0000 (16:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Oct 2020 06:02:47 +0000 (08:02 +0200)
[ Upstream commit b4be5a53ebf478ffcfb4c98c0ccc4a8d922b9a02 ]

Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
by accident, because a mac80211 issue breaks AQL on drivers with firmware
rate control that report the rate via ieee80211_tx_status_ext as struct
rate_info.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200812144943.91974-1-nbd@nbd.name
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7915/init.c
drivers/net/wireless/mediatek/mt76/mt7915/mac.c

index aadf56e80bae8db076d6358e693ac8673d8c36e4..d7a3b05ab50c3e2c935f8b2b020fa6bee8a040b2 100644 (file)
@@ -691,8 +691,12 @@ void mt7915_unregister_device(struct mt7915_dev *dev)
        spin_lock_bh(&dev->token_lock);
        idr_for_each_entry(&dev->token, txwi, id) {
                mt7915_txp_skb_unmap(&dev->mt76, txwi);
-               if (txwi->skb)
-                       dev_kfree_skb_any(txwi->skb);
+               if (txwi->skb) {
+                       struct ieee80211_hw *hw;
+
+                       hw = mt76_tx_status_get_hw(&dev->mt76, txwi->skb);
+                       ieee80211_free_txskb(hw, txwi->skb);
+               }
                mt76_put_txwi(&dev->mt76, txwi);
        }
        spin_unlock_bh(&dev->token_lock);
index a264e304a3dfb5c991bd85a10ab03b0349c0b352..5800b2d1fb233ccd8fa9bde418f3cafaa8a43924 100644 (file)
@@ -844,7 +844,7 @@ mt7915_tx_complete_status(struct mt76_dev *mdev, struct sk_buff *skb,
        if (sta || !(info->flags & IEEE80211_TX_CTL_NO_ACK))
                mt7915_tx_status(sta, hw, info, NULL);
 
-       dev_kfree_skb(skb);
+       ieee80211_free_txskb(hw, skb);
 }
 
 void mt7915_txp_skb_unmap(struct mt76_dev *dev,