mirror_ubuntu-kernels/drivers/net/wireless/mediatek/mt76/mt7921
Deren Wu fa3fbe6403 wifi: mt76: mt7921e: fix crash in chip reset fail
In case of drv own fail in reset, we may need to run mac_reset several
times. The sequence would trigger system crash as the log below.

Because we do not re-enable/schedule "tx_napi" before disable it again,
the process would keep waiting for state change in napi_diable(). To
avoid the problem and keep status synchronize for each run, goto final
resource handling if drv own failed.

[ 5857.353423] mt7921e 0000:3b:00.0: driver own failed
[ 5858.433427] mt7921e 0000:3b:00.0: Timeout for driver own
[ 5859.633430] mt7921e 0000:3b:00.0: driver own failed
[ 5859.633444] ------------[ cut here ]------------
[ 5859.633446] WARNING: CPU: 6 at kernel/kthread.c:659 kthread_park+0x11d
[ 5859.633717] Workqueue: mt76 mt7921_mac_reset_work [mt7921_common]
[ 5859.633728] RIP: 0010:kthread_park+0x11d/0x150
[ 5859.633736] RSP: 0018:ffff8881b676fc68 EFLAGS: 00010202
......
[ 5859.633766] Call Trace:
[ 5859.633768]  <TASK>
[ 5859.633771]  mt7921e_mac_reset+0x176/0x6f0 [mt7921e]
[ 5859.633778]  mt7921_mac_reset_work+0x184/0x3a0 [mt7921_common]
[ 5859.633785]  ? mt7921_mac_set_timing+0x520/0x520 [mt7921_common]
[ 5859.633794]  ? __kasan_check_read+0x11/0x20
[ 5859.633802]  process_one_work+0x7ee/0x1320
[ 5859.633810]  worker_thread+0x53c/0x1240
[ 5859.633818]  kthread+0x2b8/0x370
[ 5859.633824]  ? process_one_work+0x1320/0x1320
[ 5859.633828]  ? kthread_complete_and_exit+0x30/0x30
[ 5859.633834]  ret_from_fork+0x1f/0x30
[ 5859.633842]  </TASK>

Cc: stable@vger.kernel.org
Fixes: 0efaf31dec ("mt76: mt7921: fix MT7921E reset failure")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Link: https://lore.kernel.org/r/727eb5ffd3c7c805245e512da150ecf0a7154020.1659452909.git.deren.wu@mediatek.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-08-26 13:14:22 +02:00
..
acpi_sar.c mt76: mt7921: introduce ACPI SAR support 2022-07-11 13:40:00 +02:00
acpi_sar.h mt76: mt7921: introduce ACPI SAR support 2022-07-11 13:40:00 +02:00
debugfs.c mt76: mt7921: disable runtime pm for usb 2022-03-16 17:40:23 +01:00
dma.c mt76: connac: move tx initialization/cleanup in mt76_connac module 2022-07-11 13:40:03 +02:00
eeprom.h mt76: mt7921: add EEPROM support 2021-01-29 18:09:56 +01:00
init.c mt76: mt7921: enable HW beacon filter in the initialization stage 2022-07-11 13:40:03 +02:00
Kconfig mt76: mt7921: add mt7921u driver 2022-03-16 17:40:23 +01:00
mac.c mt76: mt7921: reduce the mutex lock scope during reset 2022-07-11 13:40:03 +02:00
mac.h mt76: move mt76_connac2_mcu_fill_message in mt76_connac module 2022-07-11 13:40:02 +02:00
main.c mt76 patches for 5.20 2022-07-18 14:32:59 +03:00
Makefile mt76: mt7921: introduce ACPI SAR support 2022-07-11 13:40:00 +02:00
mcu.c mt76 patches for 5.20 2022-07-18 14:32:59 +03:00
mcu.h mt76: move mt76_connac2_mcu_fill_message in mt76_connac module 2022-07-11 13:40:02 +02:00
mt7921_trace.h mt76: mt7921: introduce MCU_EVENT_LP_INFO event parsing 2021-04-12 23:07:25 +02:00
mt7921.h mt76: connac: move tx initialization/cleanup in mt76_connac module 2022-07-11 13:40:03 +02:00
pci_mac.c wifi: mt76: mt7921e: fix crash in chip reset fail 2022-08-26 13:14:22 +02:00
pci_mcu.c mt76: move mt76_connac2_mcu_fill_message in mt76_connac module 2022-07-11 13:40:02 +02:00
pci.c mt76: mt7921: Let PCI core handle power state and use pm_sleep_ptr() 2022-07-11 13:40:03 +02:00
regs.h mt76: mt7921u: add suspend/resume support 2022-05-13 09:39:34 +02:00
sdio_mac.c mt76: mt7921: move mt7921_usb_sdio_tx_status_data in mac common code. 2022-03-16 17:40:23 +01:00
sdio_mcu.c mt76: move mt76_connac2_mcu_fill_message in mt76_connac module 2022-07-11 13:40:02 +02:00
sdio.c mt76: mt7921: get rid of mt7921_mcu_exit 2022-07-11 13:40:01 +02:00
testmode.c mt76: connac: introduce MCU_CE_CMD macro 2021-12-19 15:24:03 +01:00
trace.c mt76: mt7921: introduce MCU_EVENT_LP_INFO event parsing 2021-04-12 23:07:25 +02:00
usb_mac.c mt76: mt7921: get rid of mt7921_mcu_exit 2022-07-11 13:40:01 +02:00
usb.c mt76: move mt76_connac2_mcu_fill_message in mt76_connac module 2022-07-11 13:40:02 +02:00