From 3c4c9a647e4feff3a42ee94d477041fdcf26c463 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Sat, 15 Jul 2017 17:09:37 +0200 Subject: [PATCH] tx: move state check in mt76_txq_send_burst() Move device state check in mt76_txq_send_burst() in order to be more reactive in stopping tx process during hw reset Signed-off-by: Lorenzo Bianconi --- tx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tx.c b/tx.c index 812a5272a..627262ac3 100644 --- a/tx.c +++ b/tx.c @@ -332,6 +332,10 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq, if (probe) break; + if (test_bit(MT76_SCANNING, &dev->state) || + test_bit(MT76_RESET, &dev->state)) + return -EBUSY; + skb = mt76_txq_dequeue(dev, mtxq, false); if (!skb) { *empty = true; @@ -418,10 +422,6 @@ void mt76_txq_schedule(struct mt76_dev *dev, struct mt76_queue *hwq) { int len; - if (test_bit(MT76_SCANNING, &dev->state) || - test_bit(MT76_RESET, &dev->state)) - return; - do { if (hwq->swq_queued >= 4 || list_empty(&hwq->swq)) break;