From 601cb9452fa568e3b75dda958ccd2a0842a35272 Mon Sep 17 00:00:00 2001 From: Vivek Date: Wed, 30 Jan 2019 00:27:23 +0530 Subject: [PATCH] qcacmn: Fix number of active command timers in psoc In psoc open, driver try to get the number of PDEV and allocate memory for number of timers. But during psoc open number of pdev are 0, thus timers are not allocated for non scan active queues. Now if all scan active queues are full and a non scan command is activated, it tries to find empty timer, which is not found, as all timers are used by scan commands. Thus timer is not started for this command and when this command is aborted the timer destroy API return failure and thus the command is not removed from the active queue. Allocate the timer during psoc enable where pdevs are already created and driver can get the number of pdev and print error if start timer fails for a command. Change-Id: Ia5b22e2849c58992a7d3d4097becc257ac673157 CRs-Fixed: 2389157 --- .../dispatcher/src/dispatcher_init_deinit.c | 17 ++++++++--------- .../serialization/inc/wlan_serialization_api.h | 8 ++++---- .../src/wlan_serialization_internal.c | 8 +++++++- .../serialization/src/wlan_serialization_main.c | 6 ++++-- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index 2d00c103d259..e1db7388554a 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -855,9 +855,6 @@ QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc) if (QDF_STATUS_SUCCESS != ucfg_scan_psoc_open(psoc)) goto scan_psoc_open_fail; - if (QDF_STATUS_SUCCESS != wlan_serialization_psoc_open(psoc)) - goto serialization_psoc_open_fail; - if (QDF_STATUS_SUCCESS != cp_stats_psoc_open(psoc)) goto cp_stats_psoc_open_fail; @@ -884,8 +881,6 @@ regulatory_psoc_open_fail: atf_psoc_open_fail: cp_stats_psoc_close(psoc); cp_stats_psoc_open_fail: - wlan_serialization_psoc_close(psoc); -serialization_psoc_open_fail: ucfg_scan_psoc_close(psoc); scan_psoc_open_fail: wlan_mgmt_txrx_psoc_close(psoc); @@ -907,8 +902,6 @@ QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc) QDF_BUG(QDF_STATUS_SUCCESS == cp_stats_psoc_close(psoc)); - QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_psoc_close(psoc)); - QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_psoc_close(psoc)); QDF_BUG(QDF_STATUS_SUCCESS == wlan_mgmt_txrx_psoc_close(psoc)); @@ -919,9 +912,12 @@ qdf_export_symbol(dispatcher_psoc_close); QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc) { - if (QDF_STATUS_SUCCESS != ucfg_scan_psoc_enable(psoc)) + if (QDF_STATUS_SUCCESS != wlan_serialization_psoc_enable(psoc)) goto out; + if (QDF_STATUS_SUCCESS != ucfg_scan_psoc_enable(psoc)) + goto serialization_psoc_enable_fail; + if (QDF_STATUS_SUCCESS != sa_api_psoc_enable(psoc)) goto sa_api_psoc_enable_fail; @@ -964,7 +960,8 @@ cp_stats_psoc_enable_fail: sa_api_psoc_disable(psoc); sa_api_psoc_enable_fail: ucfg_scan_psoc_disable(psoc); - +serialization_psoc_enable_fail: + wlan_serialization_psoc_disable(psoc); out: return QDF_STATUS_E_FAILURE; } @@ -990,6 +987,8 @@ QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc) QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_psoc_disable(psoc)); + QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_psoc_disable(psoc)); + return QDF_STATUS_SUCCESS; } qdf_export_symbol(dispatcher_psoc_disable); diff --git a/umac/cmn_services/serialization/inc/wlan_serialization_api.h b/umac/cmn_services/serialization/inc/wlan_serialization_api.h index 0a87dca14313..8bea051d95dc 100644 --- a/umac/cmn_services/serialization/inc/wlan_serialization_api.h +++ b/umac/cmn_services/serialization/inc/wlan_serialization_api.h @@ -440,18 +440,18 @@ QDF_STATUS wlan_serialization_init(void); QDF_STATUS wlan_serialization_deinit(void); /** - * @wlan_serialization_psoc_open() - Serialization component open routine + * @wlan_serialization_psoc_enable() - Serialization component enable routine * * Return - QDF Status */ -QDF_STATUS wlan_serialization_psoc_open(struct wlan_objmgr_psoc *psoc); +QDF_STATUS wlan_serialization_psoc_enable(struct wlan_objmgr_psoc *psoc); /** - * @wlan_serialization_psoc_close() - Serialization component close routine + * @wlan_serialization_psoc_disable() - Serialization component disable routine * * Return - QDF Status */ -QDF_STATUS wlan_serialization_psoc_close(struct wlan_objmgr_psoc *psoc); +QDF_STATUS wlan_serialization_psoc_disable(struct wlan_objmgr_psoc *psoc); /** * wlan_serialization_vdev_scan_status() - Return the status of the vdev scan diff --git a/umac/cmn_services/serialization/src/wlan_serialization_internal.c b/umac/cmn_services/serialization/src/wlan_serialization_internal.c index 7d6b12493c4a..d86ea4743dab 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_internal.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_internal.c @@ -773,7 +773,13 @@ wlan_serialization_find_and_start_timer(struct wlan_objmgr_psoc *psoc, qdf_timer_mod(&ser_timer->timer, cmd->cmd_timeout_duration); - ser_debug("starting timer for cmd: type[%d] id[%d] high_priority[%d] blocking[%d]", + ser_debug("Started timer for cmd: type[%d] id[%d] high_priority[%d] blocking[%d]", + cmd->cmd_type, + cmd->cmd_id, + cmd->is_high_priority, + cmd->is_blocking); + } else { + ser_err("Failed to start timer for cmd: type[%d] id[%d] high_priority[%d] blocking[%d]", cmd->cmd_type, cmd->cmd_id, cmd->is_high_priority, diff --git a/umac/cmn_services/serialization/src/wlan_serialization_main.c b/umac/cmn_services/serialization/src/wlan_serialization_main.c index eea17272b75b..36f6b07eb723 100644 --- a/umac/cmn_services/serialization/src/wlan_serialization_main.c +++ b/umac/cmn_services/serialization/src/wlan_serialization_main.c @@ -32,7 +32,7 @@ #include "wlan_serialization_rules_i.h" #include "wlan_serialization_utils_i.h" -QDF_STATUS wlan_serialization_psoc_close(struct wlan_objmgr_psoc *psoc) +QDF_STATUS wlan_serialization_psoc_disable(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status = QDF_STATUS_E_FAILURE; struct wlan_ser_psoc_obj *ser_soc_obj = @@ -56,7 +56,7 @@ error: return status; } -QDF_STATUS wlan_serialization_psoc_open(struct wlan_objmgr_psoc *psoc) +QDF_STATUS wlan_serialization_psoc_enable(struct wlan_objmgr_psoc *psoc) { uint8_t pdev_count; struct wlan_ser_psoc_obj *ser_soc_obj = @@ -72,6 +72,8 @@ QDF_STATUS wlan_serialization_psoc_open(struct wlan_objmgr_psoc *psoc) ser_soc_obj->max_active_cmds = WLAN_SER_MAX_ACTIVE_SCAN_CMDS + (pdev_count * WLAN_SER_MAX_VDEVS); + ser_debug("max_active_cmds %d", ser_soc_obj->max_active_cmds); + ser_soc_obj->timers = qdf_mem_malloc(sizeof(struct wlan_serialization_timer) * ser_soc_obj->max_active_cmds);