diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index 215759cbb2bb..d3ba3ab8fbb0 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -752,6 +752,7 @@ QDF_STATUS sme_ps_enable_auto_ps_timer(mac_handle_t mac_handle, struct ps_global_info *ps_global_info = &mac_ctx->sme.ps_global_info; struct ps_params *ps_param = &ps_global_info->ps_params[session_id]; QDF_STATUS qdf_status; + QDF_TIMER_STATE cur_state; if (!timeout && !mac_ctx->usr_cfg_ps_enable) { sme_debug("auto_ps_timer called with timeout 0; ignore"); @@ -760,8 +761,15 @@ QDF_STATUS sme_ps_enable_auto_ps_timer(mac_handle_t mac_handle, if (!timeout) timeout = AUTO_PS_ENTRY_TIMER_DEFAULT_VALUE; - sme_debug("Start auto_ps_timer for %d ms", timeout); + cur_state = + qdf_mc_timer_get_current_state(&ps_param->auto_ps_enable_timer); + if (cur_state == QDF_TIMER_STATE_STARTING || + cur_state == QDF_TIMER_STATE_RUNNING) { + sme_debug("auto_ps_timer is already started: %d", cur_state); + return QDF_STATUS_SUCCESS; + } + sme_debug("Start auto_ps_timer for %d ms", timeout); qdf_status = qdf_mc_timer_start(&ps_param->auto_ps_enable_timer, timeout); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { @@ -773,6 +781,7 @@ QDF_STATUS sme_ps_enable_auto_ps_timer(mac_handle_t mac_handle, return QDF_STATUS_E_FAILURE; } } + return QDF_STATUS_SUCCESS; }