Re: [PATCH net v5 2/5] net: ethernet: mtk_wed: fix reset condition for rx wdma

From: netdev-bot+sashiko

Date: Tue Oct 20 2026 - 06:16:57 EST


Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message for "net: ethernet: mtk_wed: fix reset
condition for rx wdma" only says the condition in mtk_wdma_rx_reset()…

--

net: ethernet: mtk_wed: fix reset condition for rx wdma

This commit inverts the check in the rx_wdma loop of mtk_wdma_rx_reset().
Allocated WDMA RX rings now have their CPU index cleared. Unallocated
rings are skipped.

> In mtk_wdma_rx_reset, only the wdma rings that weren't allocated are
> reset which is wrong.
>
> Fix this by inverting the reset condition so allocated rings will be
> reset.

[Severity: Low]
This isn't a bug, and the code change looks right. Could the commit
message say what goes wrong for users, and which paths are affected?

mtk_wed_start() sets up every rx_wdma ring that doesn't have a
descriptor yet:

drivers/net/ethernet/mediatek/mtk_wed.c:mtk_wed_start() {
...
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);
...
}

So once the device has started, all rx_wdma rings normally have a
descriptor. The exception is when buffer or ring allocation fails.

With the old condition, the loop in mtk_wdma_rx_reset() would then skip
every ring. MTK_WDMA_RING_RX(i) + MTK_WED_RING_OFS_CPU_IDX would never be
cleared for any live ring.

mtk_wdma_rx_reset() has two callers:

mtk_wed_reset_dma()
/* 2. reset WDMA rx DMA */
busy = !!mtk_wdma_rx_reset(dev);

__mtk_wed_detach()
mtk_wdma_rx_reset(dev);

Could the message add a sentence on the symptom? For example: stale WDMA
RX CPU indices after a WED/SER reset, or after detach and re-attach.

That would help reviewers and stable maintainers judge how urgent this
Fixes: patch is.

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016-wedfix-v5-0-8b02e78fd34f%40gmail.com