Skip to content

Commit

Permalink
rtw88: leave PS state for dynamic mechanism
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan-Hsuan Chuang authored and Kalle Valo committed Oct 2, 2019
1 parent d3e20fd commit 37ba5de
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/net/wireless/realtek/rtw88/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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++;

Expand Down

0 comments on commit 37ba5de

Please sign in to comment.