From: "Mingyen Hsieh (謝明諺)" <Mingyen.Hsieh@mediatek.com>
To: "nbd@nbd.name" <nbd@nbd.name>,
"lorenzo@kernel.org" <lorenzo@kernel.org>,
"pchelkin@ispras.ru" <pchelkin@ispras.ru>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>,
"Shayne Chen (陳軒丞)" <Shayne.Chen@mediatek.com>,
"jdamato@fastly.com" <jdamato@fastly.com>,
"Ryder Lee" <Ryder.Lee@mediatek.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"Sean Wang" <Sean.Wang@mediatek.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>
Subject: Re: [PATCH] wifi: mt76: disable napi on driver removal
Date: Mon, 12 May 2025 05:40:23 +0000 [thread overview]
Message-ID: <03c357a6054c31bfdca8ce5e87b74a0f0c1da3bd.camel@mediatek.com> (raw)
In-Reply-To: <20250506115540.19045-1-pchelkin@ispras.ru>
On Tue, 2025-05-06 at 14:55 +0300, Fedor Pchelkin wrote:
> A warning on driver removal started occurring after commit
> 9dd05df8403b
> ("net: warn if NAPI instance wasn't shut down"). Disable tx napi
> before
> deleting it in mt76_dma_cleanup().
>
> WARNING: CPU: 4 PID: 18828 at net/core/dev.c:7288
> __netif_napi_del_locked+0xf0/0x100
> CPU: 4 UID: 0 PID: 18828 Comm: modprobe Not tainted 6.15.0-rc4 #4
> PREEMPT(lazy)
> Hardware name: ASUS System Product Name/PRIME X670E-PRO WIFI, BIOS
> 3035 09/05/2024
> RIP: 0010:__netif_napi_del_locked+0xf0/0x100
> Call Trace:
> <TASK>
> mt76_dma_cleanup+0x54/0x2f0 [mt76]
> mt7921_pci_remove+0xd5/0x190 [mt7921e]
> pci_device_remove+0x47/0xc0
> device_release_driver_internal+0x19e/0x200
> driver_detach+0x48/0x90
> bus_remove_driver+0x6d/0xf0
> pci_unregister_driver+0x2e/0xb0
> __do_sys_delete_module.isra.0+0x197/0x2e0
> do_syscall_64+0x7b/0x160
> entry_SYSCALL_64_after_hwframe+0x76/0x7e
>
> Tested with mt7921e but the same pattern can be actually applied to
> other
> mt76 drivers calling mt76_dma_cleanup() during removal. Tx napi is
> enabled
> in their *_dma_init() functions and only toggled off and on again
> inside
> their suspend/resume/reset paths. So it should be okay to disable tx
> napi in such a generic way.
>
> Found by Linux Verification Center (linuxtesting.org).
>
> Fixes: 2ac515a5d74f ("mt76: mt76x02: use napi polling for tx
> cleanup")
> Cc: stable@vger.kernel.org
> Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
> ---
> 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 844af16ee551..35b4ec91979e 100644
> --- a/drivers/net/wireless/mediatek/mt76/dma.c
> +++ b/drivers/net/wireless/mediatek/mt76/dma.c
> @@ -1011,6 +1011,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev)
> int i;
>
> mt76_worker_disable(&dev->tx_worker);
> + napi_disable(&dev->tx_napi);
> netif_napi_del(&dev->tx_napi);
>
> for (i = 0; i < ARRAY_SIZE(dev->phys); i++) {
Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
prev parent reply other threads:[~2025-05-12 5:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 11:55 [PATCH] wifi: mt76: disable napi on driver removal Fedor Pchelkin
2025-05-12 5:40 ` Mingyen Hsieh (謝明諺) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03c357a6054c31bfdca8ce5e87b74a0f0c1da3bd.camel@mediatek.com \
--to=mingyen.hsieh@mediatek.com \
--cc=Ryder.Lee@mediatek.com \
--cc=Sean.Wang@mediatek.com \
--cc=Shayne.Chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=edumazet@google.com \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=matthias.bgg@gmail.com \
--cc=nbd@nbd.name \
--cc=pchelkin@ispras.ru \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox