* [PATCH] staging: rtl8723bs: call scan/join timeout handlers directly
@ 2026-06-04 13:33 Jad Keskes
0 siblings, 0 replies; only message in thread
From: Jad Keskes @ 2026-06-04 13:33 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging, linux-kernel, Jad Keskes
The survey and join command callbacks defer to the scan_to_timer and
assoc_timer at 1 jiffy when the command fails, instead of calling
the timeout handler directly. The TODO comments in the original
code explicitly note this should be done.
Replace the _set_timer(..., 1) deferral with a direct function call
to rtw_scan_timeout_handler() and _rtw_join_timeout_handler().
Cancel the pending timer first with timer_delete_sync() to prevent
the original timeout from firing later and invoking the handler a
second time on already-cleaned-up state.
Both handlers use timer_container_of() to recover the adapter
pointer from the timer field, which resolves correctly whether
called from the timer subsystem or directly.
Signed-off-by: Jad Keskes <inasj268@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index c1185c25e..cf0a67aff 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -1793,8 +1793,8 @@ void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (pcmd->res != H2C_SUCCESS) {
- /* TODO: cancel timer and do timeout handler directly... */
- _set_timer(&pmlmepriv->scan_to_timer, 1);
+ timer_delete_sync(&pmlmepriv->scan_to_timer);
+ rtw_scan_timeout_handler(&pmlmepriv->scan_to_timer);
}
/* free cmd */
@@ -1821,8 +1821,8 @@ void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (pcmd->res != H2C_SUCCESS) {
- /* TODO: cancel timer and do timeout handler directly... */
- _set_timer(&pmlmepriv->assoc_timer, 1);
+ timer_delete_sync(&pmlmepriv->assoc_timer);
+ _rtw_join_timeout_handler(&pmlmepriv->assoc_timer);
}
rtw_free_cmd_obj(pcmd);
--
2.54.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-04 13:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-04 13:33 [PATCH] staging: rtl8723bs: call scan/join timeout handlers directly Jad Keskes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®