mt76: mt76x02: fix handling MCU timeouts during hw restart
authorFelix Fietkau <nbd@nbd.name>
Sun, 16 Feb 2020 15:08:58 +0000 (16:08 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 12 May 2020 17:52:27 +0000 (19:52 +0200)
commitfd6c2dfa49b762ffe773a835ba62fa692df4c1b0
treed33462a14951b7e912563091677a781c67a31c48
parent5bb4e125815aa769a7d2ab7dc203593925bba0ba
mt76: mt76x02: fix handling MCU timeouts during hw restart

If a MCU timeout occurs before a hw restart completes, another hw restart
is scheduled, and the station state gets corrupted.
To speed up dealing with that, do not issue any MCU commands after the first
timeout, and defer handling timeouts until the reset has completed.
Also ignore errors in MCU commands during start/config to avoid making user
space fail on this condition. If it happens, another restart is scheduled
quickly, and that usually recovers the hardware properly.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
drivers/net/wireless/mediatek/mt76/mt76x02.h
drivers/net/wireless/mediatek/mt76/mt76x02_mcu.c
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c