wifi: mt76: mt7996: fix EMI rings for RRO

The RRO EMI rings only need to be allocated when WED is not active.
This patch fixes command timeout issue for the setting of WED off and
RRO on.

Fixes: 3a29164425e9 ("wifi: mt76: mt7996: Add SW path for HW-RRO v3.1")
Co-developed-by: Rex Lu <[email protected]>
Signed-off-by: Rex Lu <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Acked-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Shayne Chen
2025-11-06 11:34:56 +00:00
committed by Felix Fietkau
parent 7ce7ab881b
commit 1e0c23ff75
2 changed files with 25 additions and 9 deletions
+9 -6
View File
@@ -515,12 +515,15 @@ int mt7996_dma_rro_init(struct mt7996_dev *dev)
if (ret)
return ret;
/* We need to set cpu idx pointer before resetting the EMI
* queues.
*/
mdev->q_rx[MT_RXQ_RRO_RXDMAD_C].emi_cpu_idx =
&dev->wed_rro.emi_rings_cpu.ptr->ring[0].idx;
mt76_queue_reset(dev, &mdev->q_rx[MT_RXQ_RRO_RXDMAD_C], true);
if (!mtk_wed_device_active(&mdev->mmio.wed)) {
/* We need to set cpu idx pointer before resetting the
* EMI queues.
*/
mdev->q_rx[MT_RXQ_RRO_RXDMAD_C].emi_cpu_idx =
&dev->wed_rro.emi_rings_cpu.ptr->ring[0].idx;
mt76_queue_reset(dev, &mdev->q_rx[MT_RXQ_RRO_RXDMAD_C],
true);
}
goto start_hw_rro;
}
+16 -3
View File
@@ -961,9 +961,10 @@ static int mt7996_wed_rro_init(struct mt7996_dev *dev)
MT7996_RRO_MSDU_PG_SIZE_PER_CR);
}
if (dev->mt76.hwrro_mode == MT76_HWRRO_V3_1) {
if (!mtk_wed_device_active(&dev->mt76.mmio.wed) &&
dev->mt76.hwrro_mode == MT76_HWRRO_V3_1) {
ptr = dmam_alloc_coherent(dev->mt76.dma_dev,
sizeof(dev->wed_rro.emi_rings_cpu.ptr),
sizeof(*dev->wed_rro.emi_rings_cpu.ptr),
&dev->wed_rro.emi_rings_cpu.phy_addr,
GFP_KERNEL);
if (!ptr)
@@ -972,7 +973,7 @@ static int mt7996_wed_rro_init(struct mt7996_dev *dev)
dev->wed_rro.emi_rings_cpu.ptr = ptr;
ptr = dmam_alloc_coherent(dev->mt76.dma_dev,
sizeof(dev->wed_rro.emi_rings_dma.ptr),
sizeof(*dev->wed_rro.emi_rings_dma.ptr),
&dev->wed_rro.emi_rings_dma.phy_addr,
GFP_KERNEL);
if (!ptr)
@@ -1038,6 +1039,18 @@ static void mt7996_wed_rro_free(struct mt7996_dev *dev)
dev->wed_rro.msdu_pg[i].phy_addr);
}
if (dev->wed_rro.emi_rings_cpu.ptr)
dmam_free_coherent(dev->mt76.dma_dev,
sizeof(*dev->wed_rro.emi_rings_cpu.ptr),
dev->wed_rro.emi_rings_cpu.ptr,
dev->wed_rro.emi_rings_cpu.phy_addr);
if (dev->wed_rro.emi_rings_dma.ptr)
dmam_free_coherent(dev->mt76.dma_dev,
sizeof(*dev->wed_rro.emi_rings_dma.ptr),
dev->wed_rro.emi_rings_dma.ptr,
dev->wed_rro.emi_rings_dma.phy_addr);
if (!dev->wed_rro.session.ptr)
return;