diff mbox series

wifi: rtw89: fix SER L1 might stop entering LPS issue

Message ID 20230224082117.21241-1-pkshih@realtek.com (mailing list archive)
State Accepted
Commit 5c48f9432d06bf85ca934d7c4ecb14a7ec0c7f5d
Delegated to: Kalle Valo
Headers show
Series wifi: rtw89: fix SER L1 might stop entering LPS issue | expand

Commit Message

Ping-Ke Shih Feb. 24, 2023, 8:21 a.m. UTC
From: Chih-Kang Chang <gary.chang@realtek.com>

When SER L1 triggered, driver need to stop Rx and clear RTW89_FLAG_RUNNING
flag. If track_work check RTW89_FLAG_RUNNING simultaneously, it will check
failed and never queue track_work again, and LPS won't enter either.
Therefore, we cancel delayed work when enter SER L1, and queue delayed work
when leave SER L1.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/ser.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kalle Valo March 6, 2023, 10:08 a.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> wrote:

> From: Chih-Kang Chang <gary.chang@realtek.com>
> 
> When SER L1 triggered, driver need to stop Rx and clear RTW89_FLAG_RUNNING
> flag. If track_work check RTW89_FLAG_RUNNING simultaneously, it will check
> failed and never queue track_work again, and LPS won't enter either.
> Therefore, we cancel delayed work when enter SER L1, and queue delayed work
> when leave SER L1.
> 
> Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

5c48f9432d06 wifi: rtw89: fix SER L1 might stop entering LPS issue
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c
index 61db7189fdab8..9e9f6947e7f14 100644
--- a/drivers/net/wireless/realtek/rtw89/ser.c
+++ b/drivers/net/wireless/realtek/rtw89/ser.c
@@ -414,8 +414,11 @@  static void ser_idle_st_hdl(struct rtw89_ser *ser, u8 evt)
 
 static void ser_reset_trx_st_hdl(struct rtw89_ser *ser, u8 evt)
 {
+	struct rtw89_dev *rtwdev = container_of(ser, struct rtw89_dev, ser);
+
 	switch (evt) {
 	case SER_EV_STATE_IN:
+		cancel_delayed_work_sync(&rtwdev->track_work);
 		drv_stop_tx(ser);
 
 		if (hal_stop_dma(ser)) {
@@ -446,6 +449,8 @@  static void ser_reset_trx_st_hdl(struct rtw89_ser *ser, u8 evt)
 		hal_enable_dma(ser);
 		drv_resume_rx(ser);
 		drv_resume_tx(ser);
+		ieee80211_queue_delayed_work(rtwdev->hw, &rtwdev->track_work,
+					     RTW89_TRACK_WORK_PERIOD);
 		break;
 
 	default: