From 9687cd8708aaf2e6cb9c926800f1d10b5f5e5530 Mon Sep 17 00:00:00 2001 From: Sachin Ahuja Date: Sat, 4 Jul 2020 13:25:50 +0530 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 809181cc6cc2..c47152b40e13 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/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);