From dd72bf736748d5e94e50efaf7506f4b7edecb339 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Sat, 4 May 2019 12:34:23 +0530 Subject: [PATCH] qcacld-3.0: Stop ROC timer synchronously Mc timer is used to initialize the p2p roc timer. And the actual timer runs in the soft irq thread and when the timer exipres it posts the message to mc thread. Currently, qdf_mc_timer_stop is called to stop the timer. It calls the del_timer internally to delete the timer. del_timer() ensures that the given timer is not queued to run anywhere in the system. But the callback may be running on another CPU core can create race conditions. So use del_timer_sync to delete the roc timer. Change-Id: I2c0fd6e335fc342a3acf06ede534c84d40e19346 CRs-Fixed: 2445705 --- components/p2p/core/src/wlan_p2p_roc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/p2p/core/src/wlan_p2p_roc.c b/components/p2p/core/src/wlan_p2p_roc.c index 9994e45661f9..16e304543af3 100644 --- a/components/p2p/core/src/wlan_p2p_roc.c +++ b/components/p2p/core/src/wlan_p2p_roc.c @@ -304,7 +304,7 @@ static QDF_STATUS p2p_execute_cancel_roc_req( roc_ctx->roc_state = ROC_STATE_CANCEL_IN_PROG; qdf_event_reset(&p2p_soc_obj->cancel_roc_done); - status = qdf_mc_timer_stop(&roc_ctx->roc_timer); + status = qdf_mc_timer_stop_sync(&roc_ctx->roc_timer); if (status != QDF_STATUS_SUCCESS) p2p_err("Failed to stop roc timer, roc %pK", roc_ctx); @@ -539,7 +539,7 @@ static QDF_STATUS p2p_process_scan_complete_evt( if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state(&roc_ctx->roc_timer)) { - status = qdf_mc_timer_stop(&roc_ctx->roc_timer); + status = qdf_mc_timer_stop_sync(&roc_ctx->roc_timer); if (status != QDF_STATUS_SUCCESS) p2p_err("Failed to stop roc timer"); }