Commit 6bf3a083 authored by Chih-Kang Chang's avatar Chih-Kang Chang Committed by Kalle Valo

wifi: rtw88: add flag check before enter or leave IPS

Enter or leave IPS controlled by mac80211 before driver support HW
scan. After support HW scan, driver need to control IPS before start
HW scan and scan complete, but mac80211 also ask driver enter or leave
IPS. Therefore, we add flag check in IPS to prevent entering or
leaving IPS twice.
Signed-off-by: default avatarChih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220809084107.38137-7-pkshih@realtek.com
parent d08458b5
...@@ -19,14 +19,14 @@ static int rtw_ips_pwr_up(struct rtw_dev *rtwdev) ...@@ -19,14 +19,14 @@ static int rtw_ips_pwr_up(struct rtw_dev *rtwdev)
rtw_err(rtwdev, "leave idle state failed\n"); rtw_err(rtwdev, "leave idle state failed\n");
rtw_set_channel(rtwdev); rtw_set_channel(rtwdev);
clear_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags);
return ret; return ret;
} }
int rtw_enter_ips(struct rtw_dev *rtwdev) int rtw_enter_ips(struct rtw_dev *rtwdev)
{ {
set_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags); if (test_and_set_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags))
return 0;
rtw_coex_ips_notify(rtwdev, COEX_IPS_ENTER); rtw_coex_ips_notify(rtwdev, COEX_IPS_ENTER);
...@@ -50,6 +50,9 @@ int rtw_leave_ips(struct rtw_dev *rtwdev) ...@@ -50,6 +50,9 @@ int rtw_leave_ips(struct rtw_dev *rtwdev)
{ {
int ret; int ret;
if (!test_and_clear_bit(RTW_FLAG_INACTIVE_PS, rtwdev->flags))
return 0;
rtw_hci_link_ps(rtwdev, false); rtw_hci_link_ps(rtwdev, false);
ret = rtw_ips_pwr_up(rtwdev); ret = rtw_ips_pwr_up(rtwdev);
......
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