Browse Source

qcacmn: Handle return status when IPA UC not loaded

Currently if IPA UC is not loaded when opt wifi dp
is enabled, the return status is not handled correctly.
This causes the qdf_event_create to happen for ipa ctx
which later triggers an assert during ipa cleanup.
This fix will handle this scenario.

Change-Id: Ie0a38bd6745f54a37be422e1d352f6c2a7960bbc
CRs-Fixed: 3444783
Namita Nair 2 years ago
parent
commit
9293b993f1
1 changed files with 8 additions and 7 deletions
  1. 8 7
      ipa/core/src/wlan_ipa_core.c

+ 8 - 7
ipa/core/src/wlan_ipa_core.c

@@ -4115,12 +4115,6 @@ QDF_STATUS wlan_ipa_setup(struct wlan_ipa_priv *ipa_ctx,
 
 		status = wlan_ipa_wdi_init(ipa_ctx);
 
-		/* Register call backs for opt wifi dp */
-		if (ipa_ctx->opt_wifi_datapath) {
-			status = wlan_ipa_reg_flt_cbs(ipa_ctx);
-			ipa_info("opt_dp: Register cb status %d", status);
-		}
-
 		if (status == QDF_STATUS_SUCCESS) {
 			/* Setup IPA system pipes */
 			if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config)) {
@@ -4148,6 +4142,12 @@ QDF_STATUS wlan_ipa_setup(struct wlan_ipa_priv *ipa_ctx,
 			goto ipa_wdi_destroy;
 	}
 
+	/* Register call backs for opt wifi dp */
+	if (ipa_ctx->opt_wifi_datapath) {
+		status = wlan_ipa_reg_flt_cbs(ipa_ctx);
+		ipa_info("opt_dp: Register cb status %d", status);
+	}
+
 	qdf_event_create(&ipa_ctx->ipa_resource_comp);
 
 	ipa_debug("exit: success");
@@ -4215,7 +4215,8 @@ QDF_STATUS wlan_ipa_cleanup(struct wlan_ipa_priv *ipa_ctx)
 	if (!wlan_ipa_uc_is_enabled(ipa_ctx->config))
 		wlan_ipa_teardown_sys_pipe(ipa_ctx);
 
-	wlan_ipa_destroy_opt_wifi_flt_cb_event(ipa_ctx);
+	if (ipa_ctx->uc_loaded)
+		wlan_ipa_destroy_opt_wifi_flt_cb_event(ipa_ctx);
 
 	/* Teardown IPA sys_pipe for MCC */
 	if (wlan_ipa_uc_sta_is_enabled(ipa_ctx->config)) {