]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: only mark tx-status-failed frames as ACKed on mt76x0/2
authorFelix Fietkau <nbd@nbd.name>
Tue, 11 Mar 2025 10:36:43 +0000 (11:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:37:55 +0000 (14:37 +0200)
[ Upstream commit 0c5a89ceddc1728a40cb3313948401dd70e3c649 ]

The interrupt status polling is unreliable, which can cause status events
to get lost. On all newer chips, txs-timeout is an indication that the
packet was either never sent, or never acked.
Fixes issues with inactivity polling.

Link: https://patch.msgid.link/20250311103646.43346-6-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
drivers/net/wireless/mediatek/mt76/tx.c

index 27f04fb2796d7fc0438d71ef789b418df451699d..5a90fa556203f4f276ec41bca4154e924c696f36 100644 (file)
@@ -345,6 +345,7 @@ struct mt76_hw_cap {
 #define MT_DRV_RX_DMA_HDR              BIT(3)
 #define MT_DRV_HW_MGMT_TXQ             BIT(4)
 #define MT_DRV_AMSDU_OFFLOAD           BIT(5)
+#define MT_DRV_IGNORE_TXS_FAILED       BIT(6)
 
 struct mt76_driver_ops {
        u32 drv_flags;
index b795e7245c0750e6f900b90ad3246f611742471b..3255f9c0ef71fa8a0454cff921a11e716f21e5d3 100644 (file)
@@ -151,7 +151,8 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        static const struct mt76_driver_ops drv_ops = {
                .txwi_size = sizeof(struct mt76x02_txwi),
                .drv_flags = MT_DRV_TX_ALIGNED4_SKBS |
-                            MT_DRV_SW_RX_AIRTIME,
+                            MT_DRV_SW_RX_AIRTIME |
+                            MT_DRV_IGNORE_TXS_FAILED,
                .survey_flags = SURVEY_INFO_TIME_TX,
                .update_survey = mt76x02_update_channel,
                .tx_prepare_skb = mt76x02_tx_prepare_skb,
index f2b2fa7338457b1f5c7406e601b087294c8c5389..7a4d62bff28ffdba84adf7c130913dc417b22def 100644 (file)
@@ -209,7 +209,8 @@ static int mt76x0u_probe(struct usb_interface *usb_intf,
                         const struct usb_device_id *id)
 {
        static const struct mt76_driver_ops drv_ops = {
-               .drv_flags = MT_DRV_SW_RX_AIRTIME,
+               .drv_flags = MT_DRV_SW_RX_AIRTIME |
+                            MT_DRV_IGNORE_TXS_FAILED,
                .survey_flags = SURVEY_INFO_TIME_TX,
                .update_survey = mt76x02_update_channel,
                .tx_prepare_skb = mt76x02u_tx_prepare_skb,
index 5cd0379d86de84092b2ecdfba90764c4f68d5b0b..4e369bd87c900667def6bf5b6c5b05c1b01f525f 100644 (file)
@@ -22,7 +22,8 @@ mt76x2e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        static const struct mt76_driver_ops drv_ops = {
                .txwi_size = sizeof(struct mt76x02_txwi),
                .drv_flags = MT_DRV_TX_ALIGNED4_SKBS |
-                            MT_DRV_SW_RX_AIRTIME,
+                            MT_DRV_SW_RX_AIRTIME |
+                            MT_DRV_IGNORE_TXS_FAILED,
                .survey_flags = SURVEY_INFO_TIME_TX,
                .update_survey = mt76x02_update_channel,
                .tx_prepare_skb = mt76x02_tx_prepare_skb,
index 9369515f36a3a511917a7e9d958dba690ce75fe9..09b01e09bcfe0b49bed0b652773cbbe3831d12c9 100644 (file)
@@ -29,7 +29,8 @@ static int mt76x2u_probe(struct usb_interface *intf,
                         const struct usb_device_id *id)
 {
        static const struct mt76_driver_ops drv_ops = {
-               .drv_flags = MT_DRV_SW_RX_AIRTIME,
+               .drv_flags = MT_DRV_SW_RX_AIRTIME |
+                            MT_DRV_IGNORE_TXS_FAILED,
                .survey_flags = SURVEY_INFO_TIME_TX,
                .update_survey = mt76x02_update_channel,
                .tx_prepare_skb = mt76x02u_tx_prepare_skb,
index 134a735a06329f2dc4d3fc0078faddf156b6c2fa..3fbf0153d13ca1c163edbe74a00b2778ea150ace 100644 (file)
@@ -93,7 +93,8 @@ __mt76_tx_status_skb_done(struct mt76_dev *dev, struct sk_buff *skb, u8 flags,
        __skb_unlink(skb, &dev->status_list);
 
        /* Tx status can be unreliable. if it fails, mark the frame as ACKed */
-       if (flags & MT_TX_CB_TXS_FAILED) {
+       if (flags & MT_TX_CB_TXS_FAILED &&
+           (dev->drv->drv_flags & MT_DRV_IGNORE_TXS_FAILED)) {
                info->status.rates[0].count = 0;
                info->status.rates[0].idx = -1;
                info->flags |= IEEE80211_TX_STAT_ACK;