mt7996_mcu_parse_response() queues reset_work on every MCU timeout, also while mt7996_register_device() has not registered the hw yet. The work runs in parallel with the probe. After a failed probe, mt76_free_device() waits for it when it destroys the workqueue. mt7996_mac_full_reset() then ends with ieee80211_restart_hw() on a hw that was never registered. ieee80211_restart_work() flushes a NULL local->workqueue or uses the local that ieee80211_free_hw() freed: an oops after the failed probe. Only start the reset once recovery.hw_init_done is set, as mt7996_reset() does. Before that, leave MT76_MCU_RESET clear, so that a timeout fails its command like any other error. After a failed read, mt7996_eeprom_load() falls back to the default EEPROM data and the probe goes on. With the bit set, every command of the registered device would then fail at once. No reset would clear the bit. Fixes: d2b860454ea2 ("wifi: mt76: mt7996: reset device after MCU message timeout") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c index 4f0e59fc170e..4e1164e3afa4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -246,7 +246,8 @@ mt7996_mcu_parse_response(struct mt76_dev *mdev, int cmd, cmd, seq); spin_lock_bh(&dev->mt76.lock); - if (!test_and_set_bit(MT76_MCU_RESET, &dev->mphy.state)) + if (dev->recovery.hw_init_done && + !test_and_set_bit(MT76_MCU_RESET, &dev->mphy.state)) mt7996_mac_full_reset_queue(dev); spin_unlock_bh(&dev->mt76.lock); -- 2.47.3