From 91f2b924802e01aa18d466dd14e639598c0468e6 Mon Sep 17 00:00:00 2001 From: Dundi Raviteja Date: Wed, 15 Dec 2021 19:02:32 +0530 Subject: [PATCH] qcacld-3.0: Reschedule TWT work TWT work handler is used to send TWT enable/disable commands to firmware, it does not try to reschedule if it fails to start psoc sync operation because of which host and FW may not be in sync. To address this issue, reschedule TWT work if psoc sync operation start returns -EAGAIN. Change-Id: Ib4bbc0fe668ce086ac6997e31eb00a21ebf0d2a0 CRs-Fixed: 3094810 --- core/hdd/src/wlan_hdd_twt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_twt.c b/core/hdd/src/wlan_hdd_twt.c index 5f2c93e690..95c82500ce 100644 --- a/core/hdd/src/wlan_hdd_twt.c +++ b/core/hdd/src/wlan_hdd_twt.c @@ -43,6 +43,7 @@ #define TWT_DISABLE_COMPLETE_TIMEOUT 1000 #define TWT_ENABLE_COMPLETE_TIMEOUT 1000 #define TWT_ACK_COMPLETE_TIMEOUT 1000 +#define TWT_WORK_RESCHED_WAIT_TIME 30 #define TWT_FLOW_TYPE_ANNOUNCED 0 #define TWT_FLOW_TYPE_UNANNOUNCED 1 @@ -4524,8 +4525,16 @@ void hdd_twt_update_work_handler(void *data) int ret; ret = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy), &psoc_sync); - if (ret) + + if (ret == -EAGAIN) { + qdf_sleep(TWT_WORK_RESCHED_WAIT_TIME); + hdd_debug("rescheduling TWT work"); + wlan_twt_concurrency_update(hdd_ctx); return; + } else if (ret) { + hdd_err("can not handle TWT update %d", ret); + return; + } __hdd_twt_update_work_handler(hdd_ctx);