mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
Merge branch 'net-ethernet-mtk_wed-misc-fixes'
Zhi-Jun You says: ==================== net: ethernet: mtk_wed: misc fixes Ths patch series includes some fixes for issues that were discovered by Sashiko and one original patch fixing issue I encountered. Patch 1,2,3 fix issues that were found by Sashiko. Patch 1 was compiled test only. Patch 2,3,4 were tested on a mt7986. Patch 1 fixes tx wdma ring reset for WED v3. Patch 2 fixes the reset condition for rx wdma. Patch 3 fixes rx ring and tx wdma ring not being freed up Patch 4 fixes WED on non-DBDC mt7986. ==================== Link: https://patch.msgid.link/20261026-wedfix-v6-0-a52f6b15d2fc@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
cd74322d83
|
|
@ -257,7 +257,7 @@ mtk_wdma_rx_reset(struct mtk_wed_device *dev)
|
|||
wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++) {
|
||||
if (dev->rx_wdma[i].desc)
|
||||
if (!dev->rx_wdma[i].desc)
|
||||
continue;
|
||||
|
||||
wdma_w32(dev,
|
||||
|
|
@ -949,6 +949,14 @@ mtk_wed_free_ring(struct mtk_wed_device *dev, struct mtk_wed_ring *ring)
|
|||
static void
|
||||
mtk_wed_free_rx_rings(struct mtk_wed_device *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dev->rx_ring); i++)
|
||||
mtk_wed_free_ring(dev, &dev->rx_ring[i]);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
|
||||
mtk_wed_free_ring(dev, &dev->tx_wdma[i]);
|
||||
|
||||
mtk_wed_free_rx_buffer(dev);
|
||||
mtk_wed_free_ring(dev, &dev->rro.ring);
|
||||
}
|
||||
|
|
@ -1938,7 +1946,7 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
|
|||
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_CPU_IDX, 0);
|
||||
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_DMA_IDX, 0);
|
||||
|
||||
if (reset)
|
||||
if (!mtk_wed_is_v3_or_greater(dev->hw) && reset)
|
||||
mtk_wed_ring_reset(wdma, MTK_WED_WDMA_RING_SIZE, true);
|
||||
|
||||
if (!idx) {
|
||||
|
|
@ -2337,7 +2345,20 @@ mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
|
|||
|
||||
for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
|
||||
if (!dev->rx_wdma[i].desc)
|
||||
mtk_wed_wdma_rx_ring_setup(dev, i, 16, false);
|
||||
if (mtk_wed_wdma_rx_ring_setup(dev, i, 16, false)) {
|
||||
dev_err(dev->hw->dev, "wdma rx ring %d setup failed\n", i);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* non-DBDC MT7986 allocates only rx_ring[1] and tx_wdma[1] during setup
|
||||
* but tx_wdma[0] is also needed for WED to function.
|
||||
*/
|
||||
if (mtk_wed_is_v2(dev->hw) && !dev->rx_ring[0].desc)
|
||||
if (mtk_wed_wdma_tx_ring_setup(dev, 0, MTK_WED_WDMA_RING_SIZE, !!dev->tx_wdma[0].desc)) {
|
||||
dev_err(dev->hw->dev, "wdma tx ring 0 setup failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (dev->wlan.hw_rro) {
|
||||
for (i = 0; i < MTK_WED_RX_PAGE_QUEUES; i++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user