In order to avoid possible overflows, move tx queue accounting from
mt7663s_tx_run_queue() to mt76s_tx_queue_skb_raw()/mt76s_tx_queue_skb()
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        return -EIO;
                }
 
+               e->done = true;
                q->first = (q->first + 1) % q->ndesc;
                nframes++;
        }
 
-       spin_lock_bh(&q->lock);
-       q->queued += nframes;
-       spin_unlock_bh(&q->lock);
-
        return nframes;
 }
 
 
        bool wake;
 
        while (q->queued > n_dequeued) {
+               if (!q->entry[q->head].done)
+                       break;
+
                if (q->entry[q->head].schedule) {
                        q->entry[q->head].schedule = false;
                        n_sw_dequeued++;
        q->entry[q->tail].skb = tx_info.skb;
        q->entry[q->tail].buf_sz = len;
        q->tail = (q->tail + 1) % q->ndesc;
+       q->queued++;
 
        return idx;
 }
        q->entry[q->tail].buf_sz = len;
        q->entry[q->tail].skb = skb;
        q->tail = (q->tail + 1) % q->ndesc;
+       q->queued++;
 
 out:
        spin_unlock_bh(&q->lock);