From d87a3b89cb5535dc222237e6d48b923523673bbb Mon Sep 17 00:00:00 2001 From: sheenam monga Date: Tue, 17 Dec 2019 16:34:25 +0530 Subject: [PATCH] qcacld-3.0: Handle bus bandwidth in start and stop modules Currently, bus bandwidth is initialized and deinitialized in different memory domains which may cause leaks due to async bandwidth init and deinit. Fix is to initialize and de-initialize bus bandwidth in active domain. Change-Id: I67cf9ecdd47c8f3ca6e9b272ca379f0cac9a6c7b CRs-Fixed: 2568881 --- core/hdd/src/wlan_hdd_driver_ops.c | 2 -- core/hdd/src/wlan_hdd_main.c | 11 ++++------- core/hdd/src/wlan_hdd_power.c | 2 -- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 0bfb0f7a5ee5..12fc8d1fea7c 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -631,7 +631,6 @@ static void __hdd_soc_remove(struct device *dev) if (hdd_get_conparam() == QDF_GLOBAL_EPPING_MODE) { hdd_wlan_stop_modules(hdd_ctx, false); - hdd_bus_bandwidth_deinit(hdd_ctx); qdf_nbuf_deinit_replenish_timer(); } else { hdd_wlan_exit(hdd_ctx); @@ -747,7 +746,6 @@ static void __hdd_soc_recovery_shutdown(void) /* cancel/flush any pending/active idle shutdown work */ hdd_psoc_idle_timer_stop(hdd_ctx); hdd_bus_bw_compute_timer_stop(hdd_ctx); - hdd_bus_bandwidth_deinit(hdd_ctx); /* nothing to do if the soc is already unloaded */ if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) { diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ecc9a0c1ab43..1e32e6edbc50 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3224,6 +3224,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) } } + hdd_bus_bandwidth_init(hdd_ctx); pld_set_fw_log_mode(hdd_ctx->parent_dev, hdd_ctx->config->enable_fw_log); ret = hdd_hif_open(qdf_dev->dev, qdf_dev->drv_hdl, qdf_dev->bid, @@ -3439,6 +3440,7 @@ hif_close: hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); hdd_hif_close(hdd_ctx, hif_ctx); power_down: + hdd_bus_bandwidth_deinit(hdd_ctx); if (!reinit && !unint) pld_power_off(qdf_dev->dev); release_lock: @@ -7821,7 +7823,6 @@ void hdd_wlan_exit(struct hdd_context *hdd_ctx) hdd_wlan_stop_modules(hdd_ctx, false); - hdd_bus_bandwidth_deinit(hdd_ctx); hdd_driver_memdump_deinit(); qdf_nbuf_deinit_replenish_timer(); @@ -12311,7 +12312,8 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) wlan_hdd_free_sar_config(hdd_ctx); hdd_sap_destroy_ctx_all(hdd_ctx, is_recovery_stop); - + pld_request_bus_bandwidth(hdd_ctx->parent_dev, PLD_BUS_WIDTH_NONE); + hdd_bus_bandwidth_deinit(hdd_ctx); hdd_check_for_leaks(hdd_ctx, is_recovery_stop); hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); @@ -12320,9 +12322,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) hdd_ctx->driver_status = DRIVER_MODULES_CLOSED; hdd_info("Wlan transitioned (now CLOSED)"); - pld_request_bus_bandwidth(hdd_ctx->parent_dev, PLD_BUS_WIDTH_NONE); - hdd_bus_bw_compute_timer_stop(hdd_ctx); - done: cds_set_module_stop_in_progress(false); @@ -12743,7 +12742,6 @@ int hdd_wlan_startup(struct hdd_context *hdd_ctx) osif_request_manager_init(); hdd_driver_memdump_init(); - hdd_bus_bandwidth_init(hdd_ctx); hdd_dp_trace_init(hdd_ctx->config); @@ -12817,7 +12815,6 @@ stop_modules: hdd_wlan_stop_modules(hdd_ctx, false); memdump_deinit: - hdd_bus_bandwidth_deinit(hdd_ctx); hdd_driver_memdump_deinit(); osif_request_manager_deinit(); qdf_nbuf_deinit_replenish_timer(); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index fdffa94c2cf4..533cec358329 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1474,7 +1474,6 @@ QDF_STATUS hdd_wlan_re_init(void) hdd_err("Failed to get adapter"); hdd_dp_trace_init(hdd_ctx->config); - hdd_bus_bandwidth_init(hdd_ctx); ret = hdd_wlan_start_modules(hdd_ctx, true); if (ret) { @@ -1515,7 +1514,6 @@ QDF_STATUS hdd_wlan_re_init(void) return QDF_STATUS_SUCCESS; err_re_init: - hdd_bus_bandwidth_deinit(hdd_ctx); qdf_dp_trace_deinit(); err_ctx_null: