Commit 37ba5de2 authored by Yan-Hsuan Chuang's avatar Yan-Hsuan Chuang Committed by Kalle Valo

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: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent d3e20fd1
...@@ -174,6 +174,14 @@ static void rtw_watch_dog_work(struct work_struct *work) ...@@ -174,6 +174,14 @@ static void rtw_watch_dog_work(struct work_struct *work)
rtwdev->stats.tx_cnt = 0; rtwdev->stats.tx_cnt = 0;
rtwdev->stats.rx_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 */ /* use atomic version to avoid taking local->iflist_mtx mutex */
rtw_iterate_vifs_atomic(rtwdev, rtw_vif_watch_dog_iter, &data); 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) ...@@ -184,13 +192,6 @@ static void rtw_watch_dog_work(struct work_struct *work)
if (rtw_fw_support_lps && if (rtw_fw_support_lps &&
data.rtwvif && !data.active && data.assoc_cnt == 1) data.rtwvif && !data.active && data.assoc_cnt == 1)
rtw_enter_lps(rtwdev, data.rtwvif->port); 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++; rtwdev->watch_dog_cnt++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment