Просмотр исходного кода

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
Poddar, Siddarth 8 лет назад
Родитель
Сommit
57f4d3fca6
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      core/hdd/src/wlan_hdd_main.c

+ 4 - 1
core/hdd/src/wlan_hdd_main.c

@@ -5539,7 +5539,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);
 }
@@ -8992,11 +8992,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);