summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorYan-Hsuan Chuang <yhchuang@realtek.com>2019-10-02 05:31:23 +0300
committerKalle Valo <kvalo@codeaurora.org>2019-10-02 07:33:45 +0300
commit37ba5de2e731afbfe606d7192a8aeba625abdaba (patch)
tree087bc8b2ff6a9a95d0e4ec7870575cc6557c6170 /drivers/net
parentd3e20fd17d0b6891a3b6f598abad38da2ab6a70f (diff)
downloadlinux-37ba5de2e731afbfe606d7192a8aeba625abdaba.tar.xz
rtw88: leave PS state for dynamic mechanism
Dynamic mechanism requires BB/RF working to adjust hardware settings. But PS state periodically turns off BB/RF, could lead to wrong setting. So leave PS state before DM to make sure it works. And then check if we can enter PS state again. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/realtek/rtw88/main.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index f55eda9da827..00ebf8cc81b1 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -174,6 +174,14 @@ static void rtw_watch_dog_work(struct work_struct *work)
rtwdev->stats.tx_cnt = 0;
rtwdev->stats.rx_cnt = 0;
+ if (test_bit(RTW_FLAG_SCANNING, rtwdev->flags))
+ goto unlock;
+
+ /* make sure BB/RF is working for dynamic mech */
+ rtw_leave_lps(rtwdev);
+
+ rtw_phy_dynamic_mechanism(rtwdev);
+
/* use atomic version to avoid taking local->iflist_mtx mutex */
rtw_iterate_vifs_atomic(rtwdev, rtw_vif_watch_dog_iter, &data);
@@ -184,13 +192,6 @@ static void rtw_watch_dog_work(struct work_struct *work)
if (rtw_fw_support_lps &&
data.rtwvif && !data.active && data.assoc_cnt == 1)
rtw_enter_lps(rtwdev, data.rtwvif->port);
- else
- rtw_leave_lps(rtwdev);
-
- if (test_bit(RTW_FLAG_SCANNING, rtwdev->flags))
- goto unlock;
-
- rtw_phy_dynamic_mechanism(rtwdev);
rtwdev->watch_dog_cnt++;