summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoddar, Siddarth <siddpodd@codeaurora.org>2017-01-27 12:58:37 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-01-28 02:19:03 -0800
commit9ee614872c6a58382bef96cfb45f4ba577f0785b (patch)
tree097909f5dd7bc99f4d920dbb0113b7a6b1d96e37
parentb6292dea3928b1e44c554aba8f68062e6a5bb9ef (diff)
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
-rw-r--r--core/hdd/src/wlan_hdd_main.c5
1 files changed, 4 insertions, 1 deletions
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);