linux/drivers/net/wireless
Fedor Pchelkin 5e700b06b9 wifi: mt76: disable napi on driver removal
commit 78ab4be549 upstream.

A warning on driver removal started occurring after commit 9dd05df840
("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: 2ac515a5d7 ("mt76: mt76x02: use napi polling for tx cleanup")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250506115540.19045-1-pchelkin@ispras.ru
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-05-22 14:12:22 +02:00
..
admtek wifi: mac80211: add wake_tx_queue callback to drivers 2022-10-10 11:00:03 +02:00
ath wifi: ath12k: Fix invalid data access in ath12k_dp_rx_h_undecap_nwifi 2025-04-25 10:45:15 +02:00
atmel wifi: at76c50x: fix use after free access in at76_disconnect 2025-04-25 10:45:38 +02:00
broadcom wifi: brcm80211: fmac: Add error handling for brcmf_usb_dl_writeimage() 2025-05-09 09:43:52 +02:00
cisco wifi: airo: avoid uninitialized warning in airo_get_rate() 2023-07-11 19:22:54 -07:00
intel wifi: iwlwifi: mvm: use the right version of the rate API 2025-04-10 14:37:36 +02:00
intersil wifi: p54: Use IRQF_NO_AUTOEN flag in request_irq() 2024-12-09 10:32:00 +01:00
legacy Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
marvell wifi: mwifiex: Fix memcpy() field-spanning write warning in mwifiex_config_scan() 2024-12-09 10:32:04 +01:00
mediatek wifi: mt76: disable napi on driver removal 2025-05-22 14:12:22 +02:00
microchip wifi: radiotap: Avoid -Wflex-array-member-not-at-end warnings 2024-12-09 10:31:35 +01:00
purelifi wifi: plfxlc: Remove erroneous assert in plfxlc_mac_release 2025-05-09 09:43:57 +02:00
quantenna wifi: qtnfmac: use struct_size and size_sub for payload length 2023-03-13 15:44:29 +02:00
ralink wifi: rt2x00: correct wrong BBP register in RxDCOC calibration 2024-02-05 20:14:18 +00:00
realtek wifi: rtw89: pci: disable PCIE wake bit when PCIE deinit 2025-04-25 10:45:57 +02:00
rsi wifi: rsi: rsi_91x_usb_ops: Remove unnecessary (void*) conversions 2023-08-23 14:07:16 +03:00
silabs wifi: wfx: Fix error handling in wfx_core_init() 2024-12-09 10:32:07 +01:00
st wifi: cw1200: Avoid processing an invalid TIM IE 2024-08-29 17:33:24 +02:00
ti wifi: wl1251: fix memory leak in wl1251_tx_work 2025-04-25 10:45:38 +02:00
virtual wifi: radiotap: Avoid -Wflex-array-member-not-at-end warnings 2024-12-09 10:31:35 +01:00
zydas Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
Kconfig wifi: move raycs, wl3501 and rndis_wlan to legacy directory 2023-03-13 15:42:14 +02:00
Makefile wifi: move raycs, wl3501 and rndis_wlan to legacy directory 2023-03-13 15:42:14 +02:00