mt76: mt7921s: fix the device cannot sleep deeply in suspend
authorSean Wang <sean.wang@mediatek.com>
Fri, 19 Nov 2021 23:22:11 +0000 (07:22 +0800)
committerFelix Fietkau <nbd@nbd.name>
Sun, 19 Dec 2021 14:24:00 +0000 (15:24 +0100)
commit5ad4faca7690a88b4529238c757b6b8ead8056ec
tree797716d5c4374ac5ca21547e167a70dade5c5ecb
parent6906aa93eb93d54a42ce1902f00d6ea04ecb039b
mt76: mt7921s: fix the device cannot sleep deeply in suspend

According to the MT7921S firmware, the cmd MCU_UNI_CMD_HIF_CTRL have to
be last MCU command to execute in suspend handler and all data traffic
have to be stopped before the cmd MCU_UNI_CMD_HIF_CTRL starts as well
in order that mt7921 can successfully fall into the deep sleep mode.

Where we reuse the flag MT76_STATE_SUSPEND and avoid creating
another global flag to stop all of the traffic onto the SDIO bus.

Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
Reported-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
drivers/net/wireless/mediatek/mt76/mt7921/main.c
drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
drivers/net/wireless/mediatek/mt76/sdio.c
drivers/net/wireless/mediatek/mt76/sdio_txrx.c