From 69a3183113fec305f60e8c61ff0ada2a6fe9c0bf Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Wed, 6 May 2020 15:51:50 +0800 Subject: [PATCH] qcacld-3.0: Checking assoc state for bw timer when resuming In runtime resuming, there is no necessary to start bw timer if adapter is in non-assoc state. If bw timer has been started in idle state, there will be no match bw timer stop. In hdd_bus_bandwidth_deinit, it will consider as abnormal. Change-Id: Id36af395269ebf3a09429b2606dbd438f147f24f CRs-Fixed: 2678835 --- core/hdd/src/wlan_hdd_driver_ops.c | 2 +- core/hdd/src/wlan_hdd_main.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 47852548d660..a9185a966b5e 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1423,7 +1423,7 @@ static int wlan_hdd_runtime_resume(struct device *dev) 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_bus_bw_compute_timer_try_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 f78b48714be6..141056828338 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9329,7 +9329,11 @@ void hdd_bus_bandwidth_deinit(struct hdd_context *hdd_ctx) { hdd_enter(); + /* it is expecting the timer has been stopped or not started + * when coming deinit. + */ QDF_BUG(!qdf_periodic_work_stop_sync(&hdd_ctx->bus_bw_work)); + qdf_periodic_work_destroy(&hdd_ctx->bus_bw_work); qdf_spinlock_destroy(&hdd_ctx->bus_bw_lock); hdd_pm_qos_remove_request(hdd_ctx);