mirror_ubuntu-kernels/drivers/net/wireless/mediatek/mt76
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
..
mt76x0 mt76: usb: introduce __mt76u_init utility routine 2022-03-16 17:40:22 +01:00
mt76x2 mt76: Fix undefined behavior due to shift overflowing the constant 2022-04-10 15:19:48 +03:00
mt7603 mt76 patches for 5.20 2022-07-18 14:32:59 +03:00
mt7615 mt76 patches for 5.20 2022-07-18 14:32:59 +03:00
mt7915 mt76 patches for 5.20 2022-07-18 14:32:59 +03:00
mt7921 wifi: mt76: mt7921e: fix crash in chip reset fail 2022-08-26 13:14:22 +02:00
agg-rx.c mt76: do not attempt to reorder received 802.3 packets without agg session 2022-05-13 09:39:35 +02:00
debugfs.c mt76: debugfs: fix queue reporting for mt76-usb 2021-12-19 15:23:53 +01:00
dma.c mt76: introduce phys array in mt76_dev structure 2022-07-11 13:40:03 +02:00
dma.h
eeprom.c mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node() 2022-07-11 13:40:03 +02:00
Kconfig
mac80211.c mediatek: mt76: mac80211: Fix missing of_node_put() in mt76_led_init() 2022-07-11 13:40:03 +02:00
Makefile mt76: mt7921: fix build regression 2021-12-08 20:17:07 +02:00
mcu.c mt76: add len parameter to __mt76_mcu_msg_alloc signature 2022-07-11 13:40:03 +02:00
mmio.c mt76: mt7915: add Wireless Ethernet Dispatch support 2022-05-13 09:39:35 +02:00
mt76_connac2_mac.h mt76: move mt76_connac2_mcu_fill_message in mt76_connac module 2022-07-11 13:40:02 +02:00
mt76_connac_mac.c mt76: convert MT_TX_HW_QUEUE_EXT_PHY to MT_TX_HW_QUEUE_PHY 2022-07-11 13:40:03 +02:00
mt76_connac_mcu.c mt76 patches for 5.20 2022-07-18 14:32:59 +03:00
mt76_connac_mcu.h mt76: move mt76_connac2_mcu_fill_message in mt76_connac module 2022-07-11 13:40:02 +02:00
mt76_connac.h mt76: connac: move tx initialization/cleanup in mt76_connac module 2022-07-11 13:40:03 +02:00
mt76.h mt76: get rid of mt76_wcid_hw routine 2022-07-11 13:40:03 +02:00
mt76x02_beacon.c mt76: mt76x02: improve reliability of the beacon hang check 2022-07-11 13:40:03 +02:00
mt76x02_debugfs.c
mt76x02_dfs.c mt76: mt76x02: use mt76_phy_dfs_state to determine radar detector state 2022-02-03 16:15:05 +01:00
mt76x02_dfs.h
mt76x02_dma.h
mt76x02_eeprom.c
mt76x02_eeprom.h
mt76x02_mac.c mt76: mt76x02: improve reliability of the beacon hang check 2022-07-11 13:40:03 +02:00
mt76x02_mac.h mt76: make mt76_update_survey() per phy 2021-06-19 09:22:49 +02:00
mt76x02_mcu.c
mt76x02_mcu.h
mt76x02_mmio.c mt76: pass original queue id from __mt76_tx_queue_skb to the driver 2022-07-11 13:40:03 +02:00
mt76x02_phy.c
mt76x02_phy.h
mt76x02_regs.h mt76x02: improve mac error check/reset reliability 2022-02-03 14:34:35 +01:00
mt76x02_trace.c
mt76x02_trace.h
mt76x02_txrx.c
mt76x02_usb_core.c mt76: fix possible pktid leak 2021-11-24 19:21:50 +02:00
mt76x02_usb_mcu.c mt76: mt76x02u: fix possible memory leak in __mt76x02u_mcu_send_msg 2022-07-11 13:40:00 +02:00
mt76x02_usb.h
mt76x02_util.c wifi: mac80211: change QoS settings API to take link into account 2022-07-15 11:43:15 +02:00
mt76x02.h wifi: mac80211: change QoS settings API to take link into account 2022-07-15 11:43:15 +02:00
pci.c
sdio_txrx.c mt76: use le32/16_get_bits() whenever possible 2022-03-16 17:40:22 +01:00
sdio.c mt76: remove q->qid 2022-07-11 13:40:03 +02:00
sdio.h mt76: mt7921s: fix mt7921s_mcu_[fw|drv]_pmctrl 2022-02-03 13:57:59 +01:00
testmode.c mt76: convert MT_TX_HW_QUEUE_EXT_PHY to MT_TX_HW_QUEUE_PHY 2022-07-11 13:40:03 +02:00
testmode.h wireless-drivers-next patches for v5.17 2021-12-23 09:12:37 -08:00
trace.c
trace.h
tx.c mt76: convert MT_TX_HW_QUEUE_EXT_PHY to MT_TX_HW_QUEUE_PHY 2022-07-11 13:40:03 +02:00
usb_trace.c
usb_trace.h
usb.c mt76: remove q->qid 2022-07-11 13:40:03 +02:00
util.c
util.h mt76: Make use of the helper macro kthread_run() 2021-10-23 13:23:45 +02:00