From 8526c047b2acbe8a620acde97281b6c28b17e72a Mon Sep 17 00:00:00 2001 From: Bapiraju Alla Date: Thu, 2 Jul 2020 09:28:00 +0530 Subject: [PATCH] qcacld-3.0: Restore ps params after current modules being stopped Currently for monitor mode, PS params are disabled during the start modules and restored at the beginning of stop modules. This will cause an issue when hdd_wlan_unregister_pm_qos_notifier is called from stop modules with restored configuration. To resolve this, restore ps configuration at the end of stop modules. Change-Id: Ib9db4adf489a8e92cd95cdc547e3c91cc953f1b5 CRs-Fixed: 2720016 --- core/hdd/src/wlan_hdd_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 005cfdcd3e20..55bb4b326621 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3829,6 +3829,10 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) goto close; } + /* Override PS params for monitor mode */ + if (hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE) + hdd_override_all_ps(hdd_ctx); + status = cds_dp_open(hdd_ctx->psoc); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to Open cds post open; status: %d", @@ -3883,10 +3887,6 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) break; } - /* Override PS params for monitor mode */ - if (hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE) - hdd_override_all_ps(hdd_ctx); - ret = hdd_configure_cds(hdd_ctx); if (ret) { hdd_err("Failed to Enable cds modules; errno: %d", ret); @@ -13207,10 +13207,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) case DRIVER_MODULES_ENABLED: hdd_debug("Wlan transitioning (CLOSED <- ENABLED)"); - /* Restore PS params for monitor mode */ - if (hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE) - hdd_restore_all_ps(hdd_ctx); - if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) { hdd_disable_power_management(hdd_ctx); break; @@ -13344,6 +13340,10 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) hdd_check_for_leaks(hdd_ctx, is_recovery_stop); hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); + /* Restore PS params for monitor mode */ + if (hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE) + hdd_restore_all_ps(hdd_ctx); + /* Once the firmware sequence is completed reset this flag */ hdd_ctx->imps_enabled = false; hdd_ctx->driver_status = DRIVER_MODULES_CLOSED;