From 9ee614872c6a58382bef96cfb45f4ba577f0785b Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Fri, 27 Jan 2017 12:58:37 +0530 Subject: qcacld-3.0: Change the timer call from qdf_timer_start to qdf_timer_mod In hdd_bus_bw_work_handler() change the timer call from qdf_timer_start to qdf_timer_mod as following race condition could be possible: 1. Softirq fires and schedules the delayed work, 2. Disconnect reconnect occurs and timer gets stopped and started from mc thread, and 3. The delayed work tries to do the add timer and kernel BUG ON because the timer is already running. CRs-Fixed: 1116652 Change-Id: I69ad49518c7b59b27069ed4212bebbc4992e3362 --- core/hdd/src/wlan_hdd_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ca24d456f70a..13c914bd2778 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5525,7 +5525,7 @@ static void hdd_bus_bw_work_handler(struct work_struct *work) /* ensure periodic timer should still be running before restarting it */ qdf_spinlock_acquire(&hdd_ctx->bus_bw_timer_lock); if (hdd_ctx->bus_bw_timer_running) - qdf_timer_start(&hdd_ctx->bus_bw_timer, + qdf_timer_mod(&hdd_ctx->bus_bw_timer, hdd_ctx->config->busBandwidthComputeInterval); qdf_spinlock_release(&hdd_ctx->bus_bw_timer_lock); } @@ -8972,11 +8972,14 @@ void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *adapter) bool can_stop = true; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + qdf_spinlock_acquire(&hdd_ctx->bus_bw_timer_lock); if (!hdd_ctx->bus_bw_timer_running) { + qdf_spinlock_release(&hdd_ctx->bus_bw_timer_lock); /* trying to stop timer, when not running is not good */ hdd_info("bus band width compute timer is not running"); return; } + qdf_spinlock_release(&hdd_ctx->bus_bw_timer_lock); if (cds_concurrent_open_sessions_running()) { status = hdd_get_front_adapter(hdd_ctx, &adapterNode); -- cgit v1.2.3