wifi: rtw89: wow: refine WoWLAN flows of HCI interrupts and low power mode
authorChih-Kang Chang <gary.chang@realtek.com>
Thu, 2 May 2024 02:24:55 +0000 (10:24 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 3 May 2024 23:58:18 +0000 (07:58 +0800)
commitbaaf806e4632a259cc959fd1c516c2d9ed48df6d
treed227c41355a83230b88593a4cc9283b1a3007363
parenta79264e8c7d378ef4792b66e118d4f5e759795e3
wifi: rtw89: wow: refine WoWLAN flows of HCI interrupts and low power mode

After enabling packet offload, the TX will be stuck after resume from
WoWLAN mode. And the 8852c gets error messages like

rtw89_8852ce 0000:04:00.0: No busy txwd pages available
rtw89_8852ce 0000:04:00.0: queue 0 txwd 100 is not idle
rtw89_8852ce 0000:04:00.0: queue 0 txwd 101 is not idle
rtw89_8852ce 0000:04:00.0: queue 0 txwd 102 is not idle
rtw89_8852ce 0000:04:00.0: queue 0 txwd 103 is not idle

If suspend/resume many times that firmware will download failed and
disconnection.

To fix these issues, We removed the rtw89_hci_disable_intr() and
rtw89_hci_enable_intr() during rtw89_wow_swap_fw() to prevent add packet
offload can't receive c2h back due to interrupt disable. Only 8852C and
8922A needs to disable interrupt before downloading fw.

Furthermore, we avoid using low power HCI mode on WoWLAN mode, to prevent
interrupt enabled, then get interrupt and calculate RXBD mismatched due to
software RXBD index already reset but hardware RXBD index not yet.

Fixes: 5c12bb66b79d ("wifi: rtw89: refine packet offload flow")
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240502022505.28966-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/ps.c
drivers/net/wireless/realtek/rtw89/wow.c