Browse Source

qcacld-3.0: Keep wake lock while HW mode is getting changed

Host should keep the wake lock from the time it sends set hw mode request to FW
till it receives the set hw mode response. This will avoid any fatal
crash condition.

Change-Id: I6ab1020811100be1adbb70b90a06285dc8bed88c
CRs-Fixed: 2060010
Krunal Soni 7 years ago
parent
commit
cebcc29de5
2 changed files with 7 additions and 2 deletions
  1. 1 0
      core/wma/inc/wma.h
  2. 6 2
      core/wma/src/wma_main.c

+ 1 - 0
core/wma/inc/wma.h

@@ -266,6 +266,7 @@ enum ds_mode {
 #define WMA_DELETE_PEER_RSP 0x05
 #define WMA_VDEV_START_REQUEST_TIMEOUT (6000)   /* 6 seconds */
 #define WMA_VDEV_STOP_REQUEST_TIMEOUT  (6000)   /* 6 seconds */
+#define WMA_VDEV_HW_MODE_REQUEST_TIMEOUT (5000) /* 5 seconds */
 
 /*
  * The firmware value has been changed recently to 0x127

+ 6 - 2
core/wma/src/wma_main.c

@@ -2758,7 +2758,7 @@ static int wma_pdev_set_hw_mode_resp_evt_handler(void *handle,
 		 */
 		return QDF_STATUS_E_NULL_VALUE;
 	}
-
+	wma_release_wmi_resp_wakelock(wma);
 	hw_mode_resp = qdf_mem_malloc(sizeof(*hw_mode_resp));
 	if (!hw_mode_resp) {
 		WMA_LOGE("%s: Memory allocation failed", __func__);
@@ -7233,9 +7233,13 @@ QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
 		goto fail;
 	}
 
+	wma_acquire_wmi_resp_wakelock(wma_handle,
+				WMA_VDEV_HW_MODE_REQUEST_TIMEOUT);
 	if (wmi_unified_soc_set_hw_mode_cmd(wma_handle->wmi_handle,
-				msg->hw_mode_index))
+				msg->hw_mode_index)) {
+		wma_release_wmi_resp_wakelock(wma_handle);
 		goto fail;
+	}
 
 	return QDF_STATUS_SUCCESS;
 fail: