Commit 9febfa67 authored by Felix Fietkau's avatar Felix Fietkau Committed by Kalle Valo

mt76: add rcu locking in tid reorder function

Avoids having the tid or station entry disappear prematurely.
Also cancel the reorder work earlier to avoid further processing delayed
by waiting for the lock to be released
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c3d7c82a
...@@ -103,6 +103,7 @@ mt76_rx_aggr_reorder_work(struct work_struct *work) ...@@ -103,6 +103,7 @@ mt76_rx_aggr_reorder_work(struct work_struct *work)
__skb_queue_head_init(&frames); __skb_queue_head_init(&frames);
local_bh_disable(); local_bh_disable();
rcu_read_lock();
spin_lock(&tid->lock); spin_lock(&tid->lock);
mt76_rx_aggr_check_release(tid, &frames); mt76_rx_aggr_check_release(tid, &frames);
...@@ -114,6 +115,7 @@ mt76_rx_aggr_reorder_work(struct work_struct *work) ...@@ -114,6 +115,7 @@ mt76_rx_aggr_reorder_work(struct work_struct *work)
REORDER_TIMEOUT); REORDER_TIMEOUT);
mt76_rx_complete(dev, &frames, -1); mt76_rx_complete(dev, &frames, -1);
rcu_read_unlock();
local_bh_enable(); local_bh_enable();
} }
...@@ -266,6 +268,8 @@ static void mt76_rx_aggr_shutdown(struct mt76_dev *dev, struct mt76_rx_tid *tid) ...@@ -266,6 +268,8 @@ static void mt76_rx_aggr_shutdown(struct mt76_dev *dev, struct mt76_rx_tid *tid)
u8 size = tid->size; u8 size = tid->size;
int i; int i;
cancel_delayed_work(&tid->reorder_work);
spin_lock_bh(&tid->lock); spin_lock_bh(&tid->lock);
tid->stopped = true; tid->stopped = true;
...@@ -280,8 +284,6 @@ static void mt76_rx_aggr_shutdown(struct mt76_dev *dev, struct mt76_rx_tid *tid) ...@@ -280,8 +284,6 @@ static void mt76_rx_aggr_shutdown(struct mt76_dev *dev, struct mt76_rx_tid *tid)
} }
spin_unlock_bh(&tid->lock); spin_unlock_bh(&tid->lock);
cancel_delayed_work(&tid->reorder_work);
} }
void mt76_rx_aggr_stop(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno) void mt76_rx_aggr_stop(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno)
......
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