From f065fcdb2daaa47a96e95d32044b4d3ab126672f Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Tue, 6 Aug 2019 16:47:08 -0700 Subject: [PATCH] qcacld-3.0: stop bus bandwidth timer during runtime suspend During runtime suspend there is no need to run the periodic bus bandwidth timer as there is no data traffic. Change-Id: I7b53b773e5f9fa2c803e8f4dbb186a30d1dc696b CRs-Fixed: 2504215 --- core/hdd/src/wlan_hdd_driver_ops.c | 11 ++++++++++- core/hdd/src/wlan_hdd_main.c | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 513052967d0b..86158b0412a2 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1351,6 +1351,11 @@ static int wlan_hdd_runtime_suspend(struct device *dev) hdd_debug("Runtime suspend done result: %d total cxpc up time %lu microseconds", err, delta); + if (status == QDF_STATUS_SUCCESS) + hdd_bus_bw_compute_timer_stop(hdd_ctx); + + hdd_debug("Runtime suspend done result: %d", err); + return err; } @@ -1405,8 +1410,12 @@ static int wlan_hdd_runtime_resume(struct device *dev) status = ucfg_pmo_psoc_bus_runtime_resume(hdd_ctx->psoc, hdd_pld_runtime_resume_cb); - if (status != QDF_STATUS_SUCCESS) + if (status != QDF_STATUS_SUCCESS) { hdd_err("PMO Runtime resume failed: %d", status); + } else { + if (policy_mgr_get_connection_count(hdd_ctx->psoc)) + hdd_bus_bw_compute_timer_start(hdd_ctx); + } hdd_debug("Runtime resume done"); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cb4030f80eb4..3e74ba7a6b1e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7744,7 +7744,6 @@ void hdd_wlan_exit(struct hdd_context *hdd_ctx) hdd_wlan_stop_modules(hdd_ctx, false); - hdd_bus_bw_compute_timer_stop(hdd_ctx); hdd_bus_bandwidth_deinit(hdd_ctx); hdd_driver_memdump_deinit(); @@ -11978,6 +11977,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) hdd_psoc_idle_timer_start(hdd_ctx); cds_set_module_stop_in_progress(false); + hdd_bus_bw_compute_timer_stop(hdd_ctx); return -EAGAIN; } } @@ -12127,6 +12127,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) 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);