Browse Source

qcacld-3.0: Add psoc op start for state ctrl param write ops

Race conditon is seen between the mode change and Wifi Off.
When mode change happens, modules are stopped and wmi handle
becomes NULL. As a part of state ctrl param write, BLM module
uses this wmi handle to send the reject ap list to FW.

Add the psoc op start protection for the ops required during
wifi off.

CRs-Fixed: 2722283
Change-Id: I8e8d9ca789dcacf201934105725e677ce9e0a031
Sachin Ahuja 4 years ago
parent
commit
9687cd8708
1 changed files with 21 additions and 1 deletions
  1. 21 1
      core/hdd/src/wlan_hdd_main.c

+ 21 - 1
core/hdd/src/wlan_hdd_main.c

@@ -14992,7 +14992,7 @@ static int wlan_hdd_state_ctrl_param_open(struct inode *inode,
 	return 0;
 }
 
-static void hdd_inform_wifi_off(void)
+static void __hdd_inform_wifi_off(void)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	int ret;
@@ -15004,6 +15004,26 @@ static void hdd_inform_wifi_off(void)
 	ucfg_blm_wifi_off(hdd_ctx->pdev);
 }
 
+static void hdd_inform_wifi_off(void)
+{
+	int ret;
+	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+	struct osif_psoc_sync *psoc_sync;
+
+	if (!hdd_ctx) {
+		hdd_err("HDD context is Null");
+		return;
+	}
+
+	ret = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy), &psoc_sync);
+	if (ret)
+		return;
+
+	__hdd_inform_wifi_off();
+
+	osif_psoc_sync_op_stop(psoc_sync);
+}
+
 void hdd_init_start_completion(void)
 {
 	INIT_COMPLETION(wlan_start_comp);