From: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
To: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>,
linux-wireless@vger.kernel.org
Cc: Felix Fietkau <nbd@nbd.name>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Ryder Lee <ryder.lee@mediatek.com>,
Shayne Chen <shayne.chen@mediatek.com>,
Sean Wang <sean.wang@mediatek.com>,
Bert Karwatzki <spasswolf@web.de>,
Devin Wittmayer <lucid_duck@justthetip.ca>,
Eric Biggers <ebiggers@kernel.org>,
Thorsten Leemhuis <linux@leemhuis.info>,
regressions@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH wireless] Revert "wifi: mt76: Disable napi when removing device"
Date: Tue, 11 Aug 2026 11:34:06 +0200 [thread overview]
Message-ID: <ad56e2b3-c3f7-4461-b963-e56fa4212ed8@green-communications.fr> (raw)
In-Reply-To: <20260804120004.523934-1-mikhail.v.gavrilov@gmail.com>
Le 04/08/2026 à 14:00, Mikhail Gavrilov a écrit :
> This reverts commit 13b7e6a96a005c656d38f3da51581deaf9866375.
>
> That commit made mt76_dma_cleanup() disable every RX NAPI instance before
> deleting it, to silence WARNs in __netif_napi_del_locked() and
> page_pool_disable_direct_recycling() seen when unloading mt7915e with an
> MT7916.
>
> On mt7921e and mt7925e the same instances are already disabled earlier,
> in mt7921e_unregister_device() and mt7925e_unregister_device(), which
> only afterwards call mt792x_dma_cleanup() -> mt76_dma_cleanup(). Each
> instance is therefore disabled twice, and napi_disable() is not
> idempotent: on return it leaves NAPIF_STATE_SCHED and NAPIF_STATE_NPSVC
> set, so the second call spins in usleep_range() forever, waiting for bits
> that nobody will clear.
>
> mt7921_pci_shutdown() and mt7925_pci_shutdown() reuse the remove path, so
> this is hit on every reboot, poweroff and module unload. It is silent:
> the stuck task keeps sleeping and rescheduling, so neither the hung task
> detector nor the lockup detectors fire, and the last line on the console
> is "systemd-shutdown[1]: Rebooting."
>
> task:modprobe state:D stack:25720 pid:7954 tgid:7954
> Call Trace:
> <TASK>
> __schedule+0x11b8/0x26d0
> schedule+0xe7/0x2f0
> schedule_hrtimeout_range_clock+0x218/0x330
> usleep_range_state+0x133/0x1b0
> napi_disable_locked+0x37d/0x5f0
> napi_disable+0x43/0x80
> mt76_dma_cleanup+0x2b4/0x860 [mt76]
> mt7921_pci_remove+0x17f/0x350 [mt7921e]
> pci_device_remove+0xb6/0x1e0
> device_release_driver_internal+0x38d/0x540
> driver_detach+0xd0/0x1b0
> bus_remove_driver+0x127/0x2d0
> pci_unregister_driver+0x2a/0x280
> __do_sys_delete_module+0x36a/0x5b0
> do_syscall_64+0x11c/0x6d0
> entry_SYSCALL_64_after_hwframe+0x76/0x7e
> </TASK>
>
> Dropping the two driver-side loops instead was tried and rejected: with
> them gone, the RX poll can reach mt76_token_release() via
> PKT_TYPE_TXRX_NOTIFY and mt7921_mac_tx_free() while
> mt76_connac2_tx_token_put() is running idr_destroy(&dev->token) outside
> token_lock, which is a use-after-free rather than a hang [1].
>
> Revert for now, so that reboot, poweroff and module unload work again.
> The WARNs on mt7915e are a less severe problem than an unbootable
> machine, and fixing them belongs in the drivers that delete the NAPI
> instances, where each one can pick a point that is safe for its own
> teardown order, rather than in the shared mt76_dma_cleanup().
>
> Reported-by: Bert Karwatzki <spasswolf@web.de>
> Closes: https://lore.kernel.org/all/20260724151419.26014-1-spasswolf@web.de/
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221818
> Link: https://lore.kernel.org/all/20260730050428.GA73812@sol/ [1]
> Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Acked-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Sorry for the trouble.
For what is it worth, wifibot reports: "Series targets non-next tree,
but doesn't contain any Fixes tags"
https://patchwork.kernel.org/project/linux-wireless/patch/20260804120004.523934-1-mikhail.v.gavrilov@gmail.com/
Fixes: 13b7e6a96a00 ("wifi: mt76: Disable napi when removing device")
> Sending this because the regression is now in its second week with four
> independent reporters, and the two-part alternative (this revert plus
> napi_disable() added inside mt7915_unregister_device()) needs MT7916
> hardware that I do not have. I deliberately left the mt7915 side out;
> Nicolas is best placed to do it, since MT7916 is what he reported
> against.
Did that here:
https://patchwork.kernel.org/project/linux-wireless/patch/20260810154923.32546-1-nicolas.cavallari@green-communications.fr/
next prev parent reply other threads:[~2026-08-11 9:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 12:00 Mikhail Gavrilov
2026-08-04 17:39 ` Devin Wittmayer
2026-08-11 9:11 ` Thorsten Leemhuis
2026-08-11 22:30 ` Mikhail Gavrilov
2026-08-12 7:12 ` Nicolas Cavallari
2026-08-12 7:23 ` Mikhail Gavrilov
2026-08-11 9:34 ` Nicolas Cavallari [this message]
2026-08-15 17:12 ` Andrey Golovko
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=ad56e2b3-c3f7-4461-b963-e56fa4212ed8@green-communications.fr \
--to=nicolas.cavallari@green-communications.fr \
--cc=ebiggers@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@leemhuis.info \
--cc=lorenzo@kernel.org \
--cc=lucid_duck@justthetip.ca \
--cc=mikhail.v.gavrilov@gmail.com \
--cc=nbd@nbd.name \
--cc=regressions@lists.linux.dev \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=shayne.chen@mediatek.com \
--cc=spasswolf@web.de \
/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
all inboxes | Powered by JetHome®