Skip to content

Commit aac9d5f

Browse files
dangowrtgregkh
authored andcommitted
net: ethernet: mtk_eth_soc: reset all TX queues on DMA free
[ Upstream commit 4db6c75 ] The purpose of resetting the TX queue is to reset the byte and packet count as well as to clear the software flow control XOFF bit. MediaTek developers pointed out that netdev_reset_queue would only resets queue 0 of the network device. Queues that are not reset may cause unexpected issues. Packets may stop being sent after reset and "transmit timeout" log may be displayed. Import fix from MediaTek's SDK to resolve this issue. Link: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/319c0d9905579a46dc448579f892f364f1f84818 Fixes: f63959c ("net: ethernet: mtk_eth_soc: implement multi-queue support for per-port queues") Signed-off-by: Daniel Golle <[email protected]> Link: https://patch.msgid.link/c9ff9adceac4f152239a0f65c397f13547639175.1746406763.git.daniel@makrotopia.org Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 35be4c0 commit aac9d5f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3140,11 +3140,19 @@ static int mtk_dma_init(struct mtk_eth *eth)
31403140
static void mtk_dma_free(struct mtk_eth *eth)
31413141
{
31423142
const struct mtk_soc_data *soc = eth->soc;
3143-
int i;
3143+
int i, j, txqs = 1;
3144+
3145+
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
3146+
txqs = MTK_QDMA_NUM_QUEUES;
3147+
3148+
for (i = 0; i < MTK_MAX_DEVS; i++) {
3149+
if (!eth->netdev[i])
3150+
continue;
3151+
3152+
for (j = 0; j < txqs; j++)
3153+
netdev_tx_reset_subqueue(eth->netdev[i], j);
3154+
}
31443155

3145-
for (i = 0; i < MTK_MAX_DEVS; i++)
3146-
if (eth->netdev[i])
3147-
netdev_reset_queue(eth->netdev[i]);
31483156
if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) {
31493157
dma_free_coherent(eth->dma_dev,
31503158
MTK_QDMA_RING_SIZE * soc->tx.desc_size,

0 commit comments

Comments
 (0)