From a62641c74700f428249b324cb266b78d9b96c102 Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Wed, 18 Mar 2020 22:30:46 +0530 Subject: [PATCH] qcacmn: add synchronous timer stop to avoid race condition Change the qdf_timer_stop to qdf_timer_sync_cancel (synchronized timer stop), so it can wait till previous handler is completed and then stop/delete the timer, to avoid race condition. Also, call this qdf_timer_sync_cancel in dp_vdev_detach_wifi3, to be symmetry with timer start in dp_vdev_attach_wifi3. Change-Id: I3e975554b5492ccfc684ffe8b021c62ef39bf4d7 CRs-Fixed: 2644432 --- dp/wifi3.0/dp_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index bba0f7c293..483c8b8d61 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -2069,7 +2069,6 @@ static void dp_soc_interrupt_detach(struct cdp_soc_t *txrx_soc) int i; if (soc->intr_mode == DP_INTR_POLL) { - qdf_timer_stop(&soc->int_timer); qdf_timer_free(&soc->int_timer); } else { hif_deregister_exec_group(soc->hif_handle, "dp_intr"); @@ -5501,8 +5500,11 @@ static QDF_STATUS dp_vdev_detach_wifi3(struct cdp_soc_t *cdp_soc, dp_rx_vdev_detach(vdev); free_vdev: - if (wlan_op_mode_monitor == vdev->opmode) + if (wlan_op_mode_monitor == vdev->opmode) { + if (soc->intr_mode == DP_INTR_POLL) + qdf_timer_sync_cancel(&soc->int_timer); pdev->monitor_vdev = NULL; + } if (vdev->vdev_dp_ext_handle) { qdf_mem_free(vdev->vdev_dp_ext_handle);