wifi: mt76: check txfree done event on the WED hw path

Check the txfree done event DW1 bit 15 when WED is enabled, to avoid
the driver reading a txfree done event before WED has finished reading
it. No need to check this flag on WED v2, otherwise SER will occur.

The bit position was previously defined as MT_DMA_CTL_BURST, which is
unused; rename it to match its function on the txfree ring.

Fixes: 83eafc9251d6 ("wifi: mt76: mt7996: add wed tx support")
Signed-off-by: Rex Lu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Rex Lu
2026-07-22 11:03:42 +02:00
committed by Felix Fietkau
parent 49ff13fc0a
commit c73ffc4a2e
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -608,6 +608,15 @@ mt76_dma_dequeue(struct mt76_dev *dev, struct mt76_queue *q, bool flush,
q->desc[idx].ctrl |= cpu_to_le32(MT_DMA_CTL_DMA_DONE);
else if (!(q->desc[idx].ctrl & cpu_to_le32(MT_DMA_CTL_DMA_DONE)))
return NULL;
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
/* on WED v3 the M_DONE bit signals that WED is done reading
* the txfree descriptor; WED v2 does not set it
*/
else if (dev->mmio.wed.version > 2 &&
mt76_queue_is_wed_tx_free(q) &&
!(q->desc[idx].ctrl & cpu_to_le32(MT_DMA_CTL_M_DONE)))
return NULL;
#endif
}
done:
q->tail = (q->tail + 1) % q->ndesc;
+1 -1
View File
@@ -11,7 +11,7 @@
#define MT_DMA_CTL_SD_LEN1 GENMASK(13, 0)
#define MT_DMA_CTL_LAST_SEC1 BIT(14)
#define MT_DMA_CTL_BURST BIT(15)
#define MT_DMA_CTL_M_DONE BIT(15)
#define MT_DMA_CTL_SD_LEN0 GENMASK(29, 16)
#define MT_DMA_CTL_LAST_SEC0 BIT(30)
#define MT_DMA_CTL_DMA_DONE BIT(31)