Bläddra i källkod

qcacld-3.0: Block WMI cmds before issuing HTC stop

WMI cmds should be blocked, before calling HTC stop
to avoid the race condition in the system

Change-Id: I677c55cd96ea6af973595eec1e759641fbea109a
CRs-Fixed: 2193653
Kabilan Kannan 7 år sedan
förälder
incheckning
fc3a8c0631
3 ändrade filer med 36 tillägg och 0 borttagningar
  1. 3 0
      core/cds/src/cds_api.c
  2. 7 0
      core/wma/inc/wma_api.h
  3. 26 0
      core/wma/src/wma_main.c

+ 3 - 0
core/cds/src/cds_api.c

@@ -860,6 +860,7 @@ QDF_STATUS cds_pre_enable(void)
 		if ((!cds_is_fw_down()) && (!cds_is_self_recovery_enabled()))
 			QDF_BUG(0);
 
+		wma_wmi_stop();
 		htc_stop(gp_cds_context->htc_ctx);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -867,6 +868,7 @@ QDF_STATUS cds_pre_enable(void)
 	if (cdp_pdev_post_attach(soc, gp_cds_context->pdev_txrx_ctx)) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
 			"Failed to attach pdev");
+		wma_wmi_stop();
 		htc_stop(gp_cds_context->htc_ctx);
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_FAILURE;
@@ -1123,6 +1125,7 @@ QDF_STATUS cds_post_disable(void)
 	hif_reset_soc(hif_ctx);
 
 	if (gp_cds_context->htc_ctx) {
+		wma_wmi_stop();
 		htc_stop(gp_cds_context->htc_ctx);
 	}
 

+ 7 - 0
core/wma/inc/wma_api.h

@@ -337,4 +337,11 @@ QDF_STATUS wma_set_vc_mode_config(void *wma_handle,
 QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE wma_handle,
 				tAniDHCPInd *ta_dhcp_ind);
 
+/**
+ * wma_wmi_stop() - send wmi stop cmd
+ *
+ *  Return: None
+ */
+void wma_wmi_stop(void);
+
 #endif

+ 26 - 0
core/wma/src/wma_main.c

@@ -2884,6 +2884,32 @@ void wma_vdev_deinit(struct wma_txrx_node *vdev)
 	vdev->is_waiting_for_key = false;
 }
 
+/**
+ * wma_wmi_stop() - generic function to block WMI commands
+ * @return: None
+ */
+void wma_wmi_stop(void)
+{
+	tp_wma_handle wma_handle;
+
+	wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
+	if (wma_handle == NULL) {
+		QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO,
+			  "wma_handle is NULL\n");
+		return;
+	}
+	wmi_stop(wma_handle->wmi_handle);
+}
+
+/**
+ * wma_open() - Allocate wma context and initialize it.
+ * @cds_context:  cds context
+ * @wma_tgt_cfg_cb: tgt config callback fun
+ * @radar_ind_cb: dfs radar indication callback
+ * @cds_cfg:  mac parameters
+ *
+ * Return: 0 on success, errno on failure
+ */
 QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 		    wma_tgt_cfg_cb tgt_cfg_cb,
 		    struct cds_config_info *cds_cfg,