summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw88/mac80211.c
diff options
context:
space:
mode:
authorPo-Hao Huang <phhuang@realtek.com>2022-01-21 15:08:12 +0800
committerKalle Valo <kvalo@kernel.org>2022-01-31 17:46:59 +0200
commitc17f27167b4cb4988ae035fb8dce0c314e9de155 (patch)
tree1fa2c59e89f5ccb3cd429feabb557cbb07da5051 /drivers/net/wireless/realtek/rtw88/mac80211.c
parenta12f809968dbf46ce2a6bc94463db8d431bb75fc (diff)
rtw88: fix idle mode flow for hw scan
Upon hw scan completion, idle mode is not re-entered. This might increase power consumption under no link mode. Fix this by adding the re-enter flow. We need another work for this since enter_ips waits for c2h_work to finish, which might lead to deadlock if caller is in the same work. Fixes: 10d162b2ed39 ("rtw88: 8822c: add ieee80211_ops::hw_scan") Signed-off-by: Po-Hao Huang <phhuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220121070813.9656-3-pkshih@realtek.com
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/mac80211.c')
-rw-r--r--drivers/net/wireless/realtek/rtw88/mac80211.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index ae7d97de5fdf..647d2662955b 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -72,6 +72,9 @@ static int rtw_ops_config(struct ieee80211_hw *hw, u32 changed)
struct rtw_dev *rtwdev = hw->priv;
int ret = 0;
+ /* let previous ips work finish to ensure we don't leave ips twice */
+ cancel_work_sync(&rtwdev->ips_work);
+
mutex_lock(&rtwdev->mutex);
rtw_leave_lps_deep(rtwdev);
@@ -614,7 +617,7 @@ static void rtw_ops_sw_scan_complete(struct ieee80211_hw *hw,
struct rtw_dev *rtwdev = hw->priv;
mutex_lock(&rtwdev->mutex);
- rtw_core_scan_complete(rtwdev, vif);
+ rtw_core_scan_complete(rtwdev, vif, false);
mutex_unlock(&rtwdev->mutex);
}