Browse Source

qcacmn: Handle OPT_WIFI_DP during IPA pipedown

Currently if OPT_DP filter reserve or add request
is received during IPA pipe disconnect, the request is
not rejected. This could cause a race condition when
WIFI is disconnected while OPT_DP transfer is initiated.
This change handles this scenario by rejecting the
OPT_DP request when pipes are going down.

Change-Id: I8ec9e2e50917ef6ec3a07f9e1833303d94134c6c
CRs-Fixed: 3520707
Namita Nair 2 năm trước cách đây
mục cha
commit
a8d48da111
1 tập tin đã thay đổi với 17 bổ sung2 xóa
  1. 17 2
      ipa/core/src/wlan_ipa_core.c

+ 17 - 2
ipa/core/src/wlan_ipa_core.c

@@ -5218,6 +5218,11 @@ int wlan_ipa_wdi_opt_dpath_flt_rsrv_cb(
 	struct wlan_objmgr_pdev *pdev;
 	int response = 0;
 
+	if (ipa_obj->ipa_pipes_down || ipa_obj->pipes_down_in_progress) {
+		ipa_err("Pipes are going down. Reject flt rsrv request");
+		return QDF_STATUS_FILT_REQ_ERROR;
+	}
+
 	pdev = ipa_obj->pdev;
 	pdev_id = ipa_obj->dp_pdev_id;
 
@@ -5235,7 +5240,7 @@ int wlan_ipa_wdi_opt_dpath_flt_rsrv_cb(
 	if (response) {
 		ipa_err("Low power feature disable failed. status %d",
 			response);
-		return QDF_STATUS_FILT_REQ_ERROR;
+		goto error;
 	}
 
 	response = cdp_ipa_pcie_link_up(ipa_obj->dp_soc);
@@ -5250,6 +5255,11 @@ int wlan_ipa_wdi_opt_dpath_flt_rsrv_cb(
 		dp_flt_params->flt_addr_params[i].ipa_flt_in_use = false;
 	}
 	return cdp_ipa_rx_cce_super_rule_setup(ipa_obj->dp_soc, dp_flt_params);
+
+error:
+	qdf_wake_lock_release(&ipa_obj->opt_dp_wake_lock,
+			      WIFI_POWER_EVENT_WAKELOCK_OPT_WIFI_DP);
+	return QDF_STATUS_FILT_REQ_ERROR;
 }
 
 int wlan_ipa_wdi_opt_dpath_flt_add_cb(
@@ -5268,6 +5278,11 @@ int wlan_ipa_wdi_opt_dpath_flt_add_cb(
 	struct wifi_dp_flt_setup *dp_flt_param = NULL;
 	void *htc_handle;
 
+	if (ipa_obj->ipa_pipes_down || ipa_obj->pipes_down_in_progress) {
+		ipa_err("Pipes are going down. Reject flt add request");
+		return QDF_STATUS_FILT_REQ_ERROR;
+	}
+
 	pdev = ipa_obj->pdev;
 	psoc = wlan_pdev_get_psoc(pdev);
 	num_flts = ipa_flt->num_tuples;
@@ -5477,11 +5492,11 @@ int wlan_ipa_wdi_opt_dpath_flt_rsrv_rel_cb(void *ipa_ctx)
 								param_val);
 	if (response) {
 		ipa_err("Low power feature enable failed. status %d", response);
-		return QDF_STATUS_FILT_REQ_ERROR;
 	}
 
 	response = cdp_ipa_pcie_link_down(ipa_obj->dp_soc);
 	ipa_info("opt_dp: Vote for PCIe link down");
+
 	dp_flt_params = &(ipa_obj->dp_cce_super_rule_flt_param);
 	for (i = 0; i < IPA_WDI_MAX_FILTER; i++)
 		 dp_flt_params->flt_addr_params[i].valid = 0;