From 1929eefb7f3e3679d0c0b3fa78108cada1cfa048 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Tue, 31 Mar 2020 12:31:02 +0530 Subject: [PATCH] qcacmn: Reset vdev_resp->timer_status to properly handle timers The vdev_resp timer status is a persistent variable that is not reset after a cycle of send/timeout is completed. This causes the old value to induce faulty behavior for the next cycle. For example in the case when vdev_start response is dropped, the timer status is set to TIMEDOUT and this status remains as such for the next time vdev_start response is received successfully. In this case, instead of deleting the timer, as the status is a faulty TIMEOUT - no action is taken. This causes the kernel to assert. To resolve the above issue, reset the vdev_resp->timer_status after stopping the timer. Change-Id: I8632c117753a7bb1f041d00c4d9395163732f5d9 CRs-Fixed: 2654040 --- target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c b/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c index bb72ce1d6e..e28f2c7ffd 100644 --- a/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c +++ b/target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c @@ -76,7 +76,6 @@ target_if_vdev_mgr_rsp_timer_stop(struct wlan_objmgr_psoc *psoc, vdev_rsp->psoc = NULL; } } else { - vdev_rsp->timer_status = QDF_STATUS_SUCCESS; if (clear_bit == DELETE_RESPONSE_BIT) { txops->psoc_vdev_rsp_timer_deinit(psoc, vdev_rsp->vdev_id); @@ -85,6 +84,12 @@ target_if_vdev_mgr_rsp_timer_stop(struct wlan_objmgr_psoc *psoc, } } + /* + * Reset the timer_status to clear any error state. As this + * variable is persistent, any leftover error status can cause + * undesirable effects. + */ + vdev_rsp->timer_status = QDF_STATUS_SUCCESS; /* * Releasing reference taken at the time of * starting response timer