diff mbox series

wifi: rtw89: fix timeout calculation in rtw89_roc_end()

Message ID 20231024143137.30393-1-dmantipov@yandex.ru (mailing list archive)
State Accepted
Commit e416514e309f7e25e577fee45a65f246f67b2261
Delegated to: Kalle Valo
Headers show
Series wifi: rtw89: fix timeout calculation in rtw89_roc_end() | expand

Commit Message

Dmitry Antipov Oct. 24, 2023, 2:31 p.m. UTC
Since 'rtw89_core_tx_kick_off_and_wait()' assumes timeout
(actually RTW89_ROC_TX_TIMEOUT) in milliseconds, I suppose
that RTW89_ROC_IDLE_TIMEOUT is in milliseconds as well. If
so, 'msecs_to_jiffies()' should be used in a call to
'ieee80211_queue_delayed_work()' from 'rtw89_roc_end()'.
Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/realtek/rtw89/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ping-Ke Shih Oct. 25, 2023, 2:12 a.m. UTC | #1
> -----Original Message-----
> From: Dmitry Antipov <dmantipov@yandex.ru>
> Sent: Tuesday, October 24, 2023 10:32 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; Dmitry Antipov <dmantipov@yandex.ru>
> Subject: [PATCH] wifi: rtw89: fix timeout calculation in rtw89_roc_end()
> 
> Since 'rtw89_core_tx_kick_off_and_wait()' assumes timeout
> (actually RTW89_ROC_TX_TIMEOUT) in milliseconds, I suppose
> that RTW89_ROC_IDLE_TIMEOUT is in milliseconds as well. If
> so, 'msecs_to_jiffies()' should be used in a call to
> 'ieee80211_queue_delayed_work()' from 'rtw89_roc_end()'.
> Compile tested only.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>

Thanks for the finding. 

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

> ---
>  drivers/net/wireless/realtek/rtw89/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
> index 4bfb4188de72..15196f07b5c0 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.c
> +++ b/drivers/net/wireless/realtek/rtw89/core.c
> @@ -2886,7 +2886,7 @@ void rtw89_roc_end(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
> 
>         if (hw->conf.flags & IEEE80211_CONF_IDLE)
>                 ieee80211_queue_delayed_work(hw, &roc->roc_work,
> -                                            RTW89_ROC_IDLE_TIMEOUT);
> +                                            msecs_to_jiffies(RTW89_ROC_IDLE_TIMEOUT));
>  }
> 
>  void rtw89_roc_work(struct work_struct *work)
> --
> 2.41.0
Kalle Valo Oct. 30, 2023, 5:22 p.m. UTC | #2
Dmitry Antipov <dmantipov@yandex.ru> wrote:

> Since 'rtw89_core_tx_kick_off_and_wait()' assumes timeout
> (actually RTW89_ROC_TX_TIMEOUT) in milliseconds, I suppose
> that RTW89_ROC_IDLE_TIMEOUT is in milliseconds as well. If
> so, 'msecs_to_jiffies()' should be used in a call to
> 'ieee80211_queue_delayed_work()' from 'rtw89_roc_end()'.
> Compile tested only.
> 
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

e416514e309f wifi: rtw89: fix timeout calculation in rtw89_roc_end()
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
index 4bfb4188de72..15196f07b5c0 100644
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
@@ -2886,7 +2886,7 @@  void rtw89_roc_end(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
 
 	if (hw->conf.flags & IEEE80211_CONF_IDLE)
 		ieee80211_queue_delayed_work(hw, &roc->roc_work,
-					     RTW89_ROC_IDLE_TIMEOUT);
+					     msecs_to_jiffies(RTW89_ROC_IDLE_TIMEOUT));
 }
 
 void rtw89_roc_work(struct work_struct *work)