linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: rtw88: coex: Prevent doing I/O during Wi-Fi power saving
@ 2024-03-20  7:50 Ping-Ke Shih
  2024-03-26  1:21 ` Ping-Ke Shih
  0 siblings, 1 reply; 2+ messages in thread
From: Ping-Ke Shih @ 2024-03-20  7:50 UTC (permalink / raw)
  To: kvalo; +Cc: ku920601, linux-wireless

From: Ching-Te Ku <ku920601@realtek.com>

Fix Wi-Fi 2.4Ghz throughput drop over than 40% when Bluetooh is idle.
The code flow will read registers during Wi-Fi power saving, and be
returned, which results in incorrect counters to do mechanism judgment.
Adjust the code flow. Will leave Wi-Fi power save mode first then update
counters.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/coex.c | 4 +++-
 drivers/net/wireless/realtek/rtw88/main.c | 5 ++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c
index 86467d2f8888..de3332eb7a22 100644
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -3937,7 +3937,9 @@ void rtw_coex_display_coex_info(struct rtw_dev *rtwdev, struct seq_file *m)
 	lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
 	bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);
 
-	if (!coex_stat->bt_disabled && !coex_stat->bt_mailbox_reply) {
+	if (!coex_stat->wl_under_ips &&
+	    (!coex_stat->wl_under_lps || coex_stat->wl_force_lps_ctrl) &&
+	    !coex_stat->bt_disabled && !coex_stat->bt_mailbox_reply) {
 		rtw_coex_get_bt_supported_version(rtwdev,
 				&coex_stat->bt_supported_version);
 		rtw_coex_get_bt_patch_version(rtwdev, &coex_stat->patch_ver);
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index ffba6b88f392..81ef4717dbf4 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -227,9 +227,6 @@ static void rtw_watch_dog_work(struct work_struct *work)
 	else
 		clear_bit(RTW_FLAG_BUSY_TRAFFIC, rtwdev->flags);
 
-	rtw_coex_wl_status_check(rtwdev);
-	rtw_coex_query_bt_hid_list(rtwdev);
-
 	if (busy_traffic != test_bit(RTW_FLAG_BUSY_TRAFFIC, rtwdev->flags))
 		rtw_coex_wl_status_change_notify(rtwdev, 0);
 
@@ -257,6 +254,8 @@ static void rtw_watch_dog_work(struct work_struct *work)
 
 	/* make sure BB/RF is working for dynamic mech */
 	rtw_leave_lps(rtwdev);
+	rtw_coex_wl_status_check(rtwdev);
+	rtw_coex_query_bt_hid_list(rtwdev);
 
 	rtw_phy_dynamic_mechanism(rtwdev);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: rtw88: coex: Prevent doing I/O during Wi-Fi power saving
  2024-03-20  7:50 [PATCH] wifi: rtw88: coex: Prevent doing I/O during Wi-Fi power saving Ping-Ke Shih
@ 2024-03-26  1:21 ` Ping-Ke Shih
  0 siblings, 0 replies; 2+ messages in thread
From: Ping-Ke Shih @ 2024-03-26  1:21 UTC (permalink / raw)
  To: Ping-Ke Shih, kvalo; +Cc: ku920601, linux-wireless

Ping-Ke Shih <pkshih@realtek.com> wrote:

> From: Ching-Te Ku <ku920601@realtek.com>
> 
> Fix Wi-Fi 2.4Ghz throughput drop over than 40% when Bluetooh is idle.
> The code flow will read registers during Wi-Fi power saving, and be
> returned, which results in incorrect counters to do mechanism judgment.
> Adjust the code flow. Will leave Wi-Fi power save mode first then update
> counters.
> 
> Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

c2c0de23f91b wifi: rtw88: coex: Prevent doing I/O during Wi-Fi power saving

---
https://github.com/pkshih/rtw.git


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-26  1:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20  7:50 [PATCH] wifi: rtw88: coex: Prevent doing I/O during Wi-Fi power saving Ping-Ke Shih
2024-03-26  1:21 ` Ping-Ke Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).