From 21116dd97606ad1bb1f675fe018f7469749e63bf Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Thu, 26 Sep 2019 13:45:08 +0530 Subject: [PATCH] qcacmn: Fix removal of the serialization command if timer start fail In case vdev is logically deleted the serialization active timer fails to start because it fails to get vdev ref count. Now in this case the cmd is not removed from the active queue and is just marked CMD_ACTIVE_MARKED_FOR_REMOVAL because CMD_MARKED_FOR_ACTIVATION is set. Even during pdev stop as CMD_MARKED_FOR_ACTIVATION is set the command is not removed. Fix is to reset CMD_MARKED_FOR_ACTIVATION flag and handle it in same way as the activate failure case. Also reset the timer cmd after timer start failure to avoid vdev ref count release by WLAN_SERIALIZATION_ID even when it failed to take the ref count in first place. Change-Id: Ic078efa8ce4ad563087381b8c95eba91894d8a48 CRs-Fixed: 2535245 --- .../serialization/src/wlan_serialization_internal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/umac/cmn_services/serialization/src/wlan_serialization_internal.c b/umac/cmn_services/serialization/src/wlan_serialization_internal.c index 8319347d812e..88e0e99c39e4 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_internal.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_internal.c @@ -335,7 +335,7 @@ QDF_STATUS wlan_serialization_activate_cmd( status = cmd_list->cmd.cmd_cb(&cmd_list->cmd, WLAN_SER_CB_ACTIVATE_CMD); - +timer_failed: wlan_serialization_acquire_lock(&pdev_queue->pdev_queue_lock); qdf_atomic_clear_bit(CMD_MARKED_FOR_ACTIVATION, @@ -345,7 +345,6 @@ QDF_STATUS wlan_serialization_activate_cmd( wlan_serialization_release_lock(&pdev_queue->pdev_queue_lock); -timer_failed: if (QDF_IS_STATUS_ERROR(status)) { wlan_serialization_dequeue_cmd(&cmd_list->cmd, SER_ACTIVATION_FAILED, @@ -805,6 +804,11 @@ wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc, status = wlan_objmgr_vdev_try_get_ref(ser_timer->cmd->vdev, WLAN_SERIALIZATION_ID); if (QDF_IS_STATUS_ERROR(status)) { + /* + * Set cmd to null so that ref release is not tried for + * vdev when timer is flushed. + */ + ser_timer->cmd = NULL; wlan_serialization_release_lock( &psoc_ser_obj->timer_lock); ser_err("Unbale to get vdev reference");