From 95b20719d9c3d6f5efad440d5851514fe221f2a7 Mon Sep 17 00:00:00 2001 From: Abhishek Ambure Date: Wed, 17 Mar 2021 17:56:46 +0530 Subject: [PATCH] qcacld-3.0: Fill wma req before pdev_set_dual_mac cmd sent to fw Presently host prepares and fills wma req in wma_hold_req_queue after sending pdev_set_dual_mac command to FW. Host uses same wma request to process response from firmware. If host gets FW response before filling wma request to wma_hold_req_queue, host fails to process pdev_set_dual_mac cmd response. And thus the wma request queued after sending pdev_set_dual_mac command gets timeout. Hence prepare and fill wma req in wma_hold_req_queue before sending pdev_set_dual_mac command to firmware. Problem scenario: 1) Host send pdev_set_dual_mac cmd to fw in kworker thread and then gets suspend before filling wma req into wma_hold_req_queue. 2) Host gets pdev_set_dual_mac cmd response from fw and schedular thread runs to process response where it doesn't get wma request. 3) Now kworker thread gets scheduled and fill wma req and gets timed out. Change-Id: I4d32e4459c32843c8fdb9a48262b5a55eecf2cbd CRs-Fixed: 2902212 --- core/wma/src/wma_main.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index cbd1c3f381be..3f1faf48064b 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -9303,6 +9303,15 @@ QDF_STATUS wma_send_pdev_set_dual_mac_config(tp_wma_handle wma_handle, return QDF_STATUS_E_NULL_VALUE; } + req_msg = wma_fill_hold_req(wma_handle, 0, + SIR_HAL_PDEV_DUAL_MAC_CFG_REQ, + WMA_PDEV_MAC_CFG_RESP, NULL, + WMA_VDEV_DUAL_MAC_CFG_TIMEOUT); + if (!req_msg) { + wma_err("Failed to allocate request for SIR_HAL_PDEV_DUAL_MAC_CFG_REQ"); + return QDF_STATUS_E_FAILURE; + } + /* * aquire the wake lock here and release it in response handler function * In error condition, release the wake lock right away @@ -9316,20 +9325,12 @@ QDF_STATUS wma_send_pdev_set_dual_mac_config(tp_wma_handle wma_handle, wma_err("Failed to send WMI_PDEV_SET_DUAL_MAC_CONFIG_CMDID: %d", status); wma_release_wakelock(&wma_handle->wmi_cmd_rsp_wake_lock); + wma_remove_req(wma_handle, 0, WMA_PDEV_MAC_CFG_RESP); goto fail; } policy_mgr_update_dbs_req_config(wma_handle->psoc, msg->scan_config, msg->fw_mode_config); - req_msg = wma_fill_hold_req(wma_handle, 0, - SIR_HAL_PDEV_DUAL_MAC_CFG_REQ, - WMA_PDEV_MAC_CFG_RESP, NULL, - WMA_VDEV_DUAL_MAC_CFG_TIMEOUT); - if (!req_msg) { - wma_err("Failed to allocate request for SIR_HAL_PDEV_DUAL_MAC_CFG_REQ"); - wma_remove_req(wma_handle, 0, WMA_PDEV_MAC_CFG_RESP); - } - return QDF_STATUS_SUCCESS; fail: @@ -9340,8 +9341,8 @@ fail: resp->status = SET_HW_MODE_STATUS_ECANCELED; wma_debug("Sending failure response to LIM"); wma_send_msg(wma_handle, SIR_HAL_PDEV_MAC_CFG_RESP, (void *) resp, 0); - return QDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; } /**