* [PATCH] wifi: mt76: disable rx napi before queue cleanup
@ 2026-05-10 23:58 Ruslan Isaev
2026-05-17 22:46 ` Ruslan Isaev
0 siblings, 1 reply; 3+ messages in thread
From: Ruslan Isaev @ 2026-05-10 23:58 UTC (permalink / raw)
To: linux-wireless
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang
mt76_dma_cleanup() already disables tx napi before deleting it, but
it still removes rx napi instances while they can remain enabled on the
normal device remove path. On mt7915 this triggers a warning.
Disable each rx napi instance before netif_napi_del() and page pool
destruction. This fixes repeated warnings on rmmod mt7915e on
mt7915e/mt7981b.
Signed-off-by: Ruslan Isaev <legale.legale@gmail.com>
---
drivers/net/wireless/mediatek/mt76/dma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index f8c2fe5f2..12183142f 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -1189,6 +1189,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev)
mt76_for_each_q_rx(dev, i) {
struct mt76_queue *q = &dev->q_rx[i];
+ napi_disable(&dev->napi[i]);
netif_napi_del(&dev->napi[i]);
mt76_dma_rx_cleanup(dev, q);
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] wifi: mt76: disable rx napi before queue cleanup
2026-05-10 23:58 [PATCH] wifi: mt76: disable rx napi before queue cleanup Ruslan Isaev
@ 2026-05-17 22:46 ` Ruslan Isaev
2026-05-22 21:42 ` Sean Wang
0 siblings, 1 reply; 3+ messages in thread
From: Ruslan Isaev @ 2026-05-17 22:46 UTC (permalink / raw)
To: linux-wireless
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang
Gentle ping for review
May 11, 2026 02:58:02 Ruslan Isaev <legale.legale@gmail.com>:
> mt76_dma_cleanup() already disables tx napi before deleting it, but
> it still removes rx napi instances while they can remain enabled on the
> normal device remove path. On mt7915 this triggers a warning.
>
> Disable each rx napi instance before netif_napi_del() and page pool
> destruction. This fixes repeated warnings on rmmod mt7915e on
> mt7915e/mt7981b.
>
> Signed-off-by: Ruslan Isaev <legale.legale@gmail.com>
> ---
> drivers/net/wireless/mediatek/mt76/dma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
> index f8c2fe5f2..12183142f 100644
> --- a/drivers/net/wireless/mediatek/mt76/dma.c
> +++ b/drivers/net/wireless/mediatek/mt76/dma.c
> @@ -1189,6 +1189,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev)
> mt76_for_each_q_rx(dev, i) {
> struct mt76_queue *q = &dev->q_rx[i];
>
> + napi_disable(&dev->napi[i]);
> netif_napi_del(&dev->napi[i]);
> mt76_dma_rx_cleanup(dev, q);
>
> --
> 2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] wifi: mt76: disable rx napi before queue cleanup
2026-05-17 22:46 ` Ruslan Isaev
@ 2026-05-22 21:42 ` Sean Wang
0 siblings, 0 replies; 3+ messages in thread
From: Sean Wang @ 2026-05-22 21:42 UTC (permalink / raw)
To: Ruslan Isaev
Cc: linux-wireless, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
Shayne Chen, Sean Wang
Hi,
On Sun, May 17, 2026 at 5:46 PM Ruslan Isaev <legale.legale@gmail.com> wrote:
>
> Gentle ping for review
>
> May 11, 2026 02:58:02 Ruslan Isaev <legale.legale@gmail.com>:
>
> > mt76_dma_cleanup() already disables tx napi before deleting it, but
> > it still removes rx napi instances while they can remain enabled on the
> > normal device remove path. On mt7915 this triggers a warning.
> >
> > Disable each rx napi instance before netif_napi_del() and page pool
> > destruction. This fixes repeated warnings on rmmod mt7915e on
> > mt7915e/mt7981b.
> >
> > Signed-off-by: Ruslan Isaev <legale.legale@gmail.com>
> > ---
> > drivers/net/wireless/mediatek/mt76/dma.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
> > index f8c2fe5f2..12183142f 100644
> > --- a/drivers/net/wireless/mediatek/mt76/dma.c
> > +++ b/drivers/net/wireless/mediatek/mt76/dma.c
> > @@ -1189,6 +1189,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev)
> > mt76_for_each_q_rx(dev, i) {
> > struct mt76_queue *q = &dev->q_rx[i];
> >
> > + napi_disable(&dev->napi[i]);
> > netif_napi_del(&dev->napi[i]);
> > mt76_dma_rx_cleanup(dev, q);
I do not think this is safe as-is.
1. I tested this on mt7925, and removing the module causes a machine
hang. I found that we can end up disabling NAPI twice on mt7921 and
mt7925. If we still need this patch, it
should be fixed together with the mt7921/mt7925 cleanup paths.
2. mt76_dma_init() skips WED RRO queues when adding RX NAPI, but
this patch disables NAPI for every allocated RX queue during cleanup.
On mt7996/mt7992 HWRRO, WED RRO queues may have
ndesc != 0, so cleanup can call napi_disable() on queues where
mt76 never added/enabled NAPI.
Please make the cleanup path use the same condition as init, for
example by skipping NAPI operations for mt76_queue_is_wed_rro(q), or
by adding a shared helper for the init/cleanup
condition.
> >
> > --
> > 2.39.5
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-22 21:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 23:58 [PATCH] wifi: mt76: disable rx napi before queue cleanup Ruslan Isaev
2026-05-17 22:46 ` Ruslan Isaev
2026-05-22 21:42 ` Sean Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox