]> 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:41:56 +0000 (14:41 +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 8b620d4fed4390caffa2b77e81a0f178097a0f9c..df0ea638370b56e2283f927b6cae029c2b1c96bf 100644 (file)
@@ -439,6 +439,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 9277ff38b7a228fd778e8c9909eed0182eb14306..57ae362dad50b78c3ced3dc83e2cff9fc011398a 100644 (file)
@@ -152,7 +152,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 0422c332354a131dab040c72a8961ec6f1b79515..520fd46227a7b8ae75018172030e22a10a8181d1 100644 (file)
@@ -210,7 +210,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 df85ebc6e1df07a7c2e48c30efa50cdeec9f993f..7e2475b3c278e0d23f07f607766503c56b144b50 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 d804309992196679f9fa6606cafc1edea8c15b7e..70d3895762b4cd8d392b0cfd1cdc0c9c99b8be7d 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 1809b03292c3d946a4a841f659f2cc1eadf642e5..47cdccdbed6aaf2bacd125263d582c657d75f4cc 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;