rtw88: tx: increase TX report timeout for USB devices
PATCH 1/1 rtw88: tx: increase TX report timeout for USB devices
patch attached!
USB devices have higher latency than PCIe devices. The current 500ms timeout for TX report purging causes "failed to get tx report from firmware" errors on boot with USB WiFi adapters.
Introduce RTW_TX_PROBE_TIMEOUT_USB at 1000ms and select it based on the HCI type. PCIe devices retain the original 500ms timeout.
Tested on RTL8822BU (Edimax EW-7822ULC) with zero TX report errors across 24+ hour operation and 17,706 packets with zero drops.
---
home/ptpx86mm1/kernelbuild/linux-6.18/drivers/net/wireless/realtek/rtw88/tx.c renamed from tmp/linux-6.18/drivers/net/wireless/realtek/rtw88/tx.c +4 -1
@@ -197,6 +197,7 @@ {struct rtw_tx_report *tx_report = &rtwdev->tx_report;unsigned long flags; +unsigned long timeout;u8 *drv_data;/* pass sn to tx report handler through driver data */
@@ -207,7 +208,9 @@__skb_queue_tail (&tx_report->queue, skb);spin_unlock_irqrestore (&tx_report->q_lock, flags); -mod_timer (&tx_report->purge_timer, jiffies +RTW_TX_PROBE_TIMEOUT ); + timeout = rtwdev->hci.type ==RTW_HCI_TYPE_USB ? +RTW_TX_PROBE_TIMEOUT_USB :RTW_TX_PROBE_TIMEOUT ; +mod_timer (&tx_report->purge_timer, jiffies + timeout); }EXPORT_SYMBOL (rtw_tx_report_enqueue);
home/ptpx86mm1/kernelbuild/linux-6.18/drivers/net/wireless/realtek/rtw88/tx.h renamed from tmp/linux-6.18/drivers/net/wireless/realtek/rtw88/tx.h +1 -0
@@ -8,6 +8,7 @@#define RTK_TX_MAX_AGG_NUM_MASK 0x1f#define RTW_TX_PROBE_TIMEOUT msecs_to_jiffies(500) +#define RTW_TX_PROBE_TIMEOUT_USB msecs_to_jiffies(1000)struct rtw_tx_desc {__le32 w0;
Please use plain text mode, and send patch by 'git send-email'.
We have [1] already, but under condition of RTL8723DU. You can extend it to involve RTL8822BU. Maybe, we can just have longer report time for all USB devices?
[1] https://lore.kernel.org/linux-wireless/[email protected]/
Ping-Ke