Commit c4a784e3 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: schedule status timeout at dma completion

Reduce MT_TX_STATUS_SKB_TIMEOUT to 250ms

Tested-by: mrkiko.rs@gmail.com
Co-developed-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent c34f1005
...@@ -308,8 +308,13 @@ struct mt76_rx_tid { ...@@ -308,8 +308,13 @@ struct mt76_rx_tid {
#define MT_PACKET_ID_NO_SKB 1 #define MT_PACKET_ID_NO_SKB 1
#define MT_PACKET_ID_FIRST 2 #define MT_PACKET_ID_FIRST 2
#define MT_PACKET_ID_HAS_RATE BIT(7) #define MT_PACKET_ID_HAS_RATE BIT(7)
/* This is timer for when to give up when waiting for TXS callback,
#define MT_TX_STATUS_SKB_TIMEOUT HZ * with starting time being the time at which the DMA_DONE callback
* was seen (so, we know packet was processed then, it should not take
* long after that for firmware to send the TXS callback if it is going
* to do so.)
*/
#define MT_TX_STATUS_SKB_TIMEOUT (HZ / 4)
struct mt76_tx_cb { struct mt76_tx_cb {
unsigned long jiffies; unsigned long jiffies;
......
...@@ -141,7 +141,6 @@ mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid, ...@@ -141,7 +141,6 @@ mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid,
cb->wcid = wcid->idx; cb->wcid = wcid->idx;
cb->pktid = pid; cb->pktid = pid;
cb->jiffies = jiffies;
if (list_empty(&wcid->list)) if (list_empty(&wcid->list))
list_add_tail(&wcid->list, &dev->wcid_list); list_add_tail(&wcid->list, &dev->wcid_list);
...@@ -179,6 +178,9 @@ mt76_tx_status_skb_get(struct mt76_dev *dev, struct mt76_wcid *wcid, int pktid, ...@@ -179,6 +178,9 @@ mt76_tx_status_skb_get(struct mt76_dev *dev, struct mt76_wcid *wcid, int pktid,
continue; continue;
} }
/* It has been too long since DMA_DONE, time out this packet
* and stop waiting for TXS callback.
*/
idr_remove(&wcid->pktid, cb->pktid); idr_remove(&wcid->pktid, cb->pktid);
__mt76_tx_status_skb_done(dev, skb, MT_TX_CB_TXS_FAILED | __mt76_tx_status_skb_done(dev, skb, MT_TX_CB_TXS_FAILED |
MT_TX_CB_TXS_DONE, list); MT_TX_CB_TXS_DONE, list);
...@@ -261,6 +263,7 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff * ...@@ -261,6 +263,7 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
} }
mt76_tx_status_lock(dev, &list); mt76_tx_status_lock(dev, &list);
cb->jiffies = jiffies;
__mt76_tx_status_skb_done(dev, skb, MT_TX_CB_DMA_DONE, &list); __mt76_tx_status_skb_done(dev, skb, MT_TX_CB_DMA_DONE, &list);
mt76_tx_status_unlock(dev, &list); mt76_tx_status_unlock(dev, &list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment