From 28e3a2d1c0b1c7efdbacb3efaac207b08edee28e Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Thu, 17 Dec 2020 10:39:35 +0800 Subject: [PATCH] qcacld-3.0: skip redundant update request for dual mac cfg Dual mac configuration is static from wlan module start to module stop, no need to update for each adapter starting. To reduce the time cost on starting adapter, add a flag to indicate the status of dual mac config, skip the update request if it's been updated. Change-Id: I033cda08173503d133a06eca617655d1cefe4d0d CRs-Fixed: 2839192 --- core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/src/wlan_hdd_main.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index fd1335eaec3f..ac035e72c546 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1760,6 +1760,7 @@ struct hdd_adapter_ops_history { * @adapter_ops_wq: High priority workqueue for handling adapter operations * @multi_client_thermal_mitigation: Multi client thermal mitigation by fw * @disconnect_for_sta_mon_conc: disconnect if sta monitor intf concurrency + * @is_dual_mac_cfg_updated: indicate whether dual mac cfg has been updated */ struct hdd_context { struct wlan_objmgr_psoc *psoc; @@ -2102,6 +2103,7 @@ struct hdd_context { bool multi_client_thermal_mitigation; #endif bool disconnect_for_sta_mon_conc; + bool is_dual_mac_cfg_updated; }; /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7a4ac4e22466..9c8e2931b05f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2984,6 +2984,11 @@ wlan_hdd_update_dbs_scan_and_fw_mode_config(void) if (!policy_mgr_find_if_fw_supports_dbs(hdd_ctx->psoc)) return QDF_STATUS_SUCCESS; + if (hdd_ctx->is_dual_mac_cfg_updated) { + hdd_debug("dual mac config has already been updated, skip"); + return QDF_STATUS_SUCCESS; + } + cfg.scan_config = 0; cfg.fw_mode_config = 0; cfg.set_dual_mac_cb = policy_mgr_soc_set_dual_mac_cfg_cb; @@ -3030,6 +3035,8 @@ wlan_hdd_update_dbs_scan_and_fw_mode_config(void) /* wait for sme_soc_set_dual_mac_config to complete */ status = policy_mgr_wait_for_dual_mac_configuration(hdd_ctx->psoc); + if (QDF_IS_STATUS_SUCCESS(status)) + hdd_ctx->is_dual_mac_cfg_updated = true; } else { hdd_err("sme_soc_set_dual_mac_config failed %d", status); return status; @@ -14316,6 +14323,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) /* Once the firmware sequence is completed reset this flag */ hdd_ctx->imps_enabled = false; + hdd_ctx->is_dual_mac_cfg_updated = false; hdd_ctx->driver_status = DRIVER_MODULES_CLOSED; hdd_debug("Wlan transitioned (now CLOSED)");