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)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Mar 2025 13:47:04 +0000 (14:47 +0100)
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>
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 c16a6743ad64cd82e606b00fb0a858926d145a30..b461273c33064259fa1bb61ea88c06a60cb07178 100644 (file)
@@ -492,6 +492,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 b456ccd00d581ffc983bed78f7578572e203db11..11c16d1fc70fc0ab3af4fbe8625c09c38adfd985 100644 (file)
@@ -156,7 +156,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,
                .set_channel = mt76x0_set_channel,
index b031c500b74156bb4b354c779054d8ad4f123c99..90e5666c0857dc64a72b005d0cfcb7717f45230a 100644 (file)
@@ -214,7 +214,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,
                .set_channel = mt76x0_set_channel,
index 727bfdd00b40007a72e0bdbcd0f29705f11545f4..2303019670e2c0d143aa0904aa553d2df84e47ad 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,
                .set_channel = mt76x2e_set_channel,
index e832ad53e2393b4fd3be1bde3a8c4a03612e7a8d..3747f9ed31e6f7655c432128587c75ba46bd384e 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,
                .set_channel = mt76x2u_set_channel,
index af0c50c983ec11d7cbf9836a8cf006daf2d9e7d8..513916469ca2f62a80e9675ffd8ea927d2bd0b86 100644 (file)
@@ -100,7 +100,8 @@ __mt76_tx_status_skb_done(struct mt76_dev *dev, struct sk_buff *skb, u8 flags,
                return;
 
        /* 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;