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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:40 +0000 (10:19 +0200)
commit28376beb1d3a97965940392177383182815d8b13
tree272bd6e082f6b10059163f66895208dd03c40fd4
parent70b8d693ddc9d9f7291e7607038d16e80b959acc
mt76: mt76x02: fix handling MCU timeouts during hw restart

[ Upstream commit fd6c2dfa49b762ffe773a835ba62fa692df4c1b0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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