summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNachiket Kukade <nkukade@codeaurora.org>2017-05-10 15:35:28 +0530
committersnandini <snandini@codeaurora.org>2017-11-14 20:19:42 -0800
commit05128de25763543ab4e9bac2d8203a255e4cc063 (patch)
tree3a678680418b599ad77c59a39104b92d1135fb48
parent7e58309c2ef5dbb84a15646a9033702ab67ba1d0 (diff)
qcacld-3.0: Utilise new APIs for waiting on events
With current implementation in case of an SSR/PDR threads that are waiting on events will only get purged after the wait timeout has occurred, increasing the recovery time for the driver. Utilize new APIs that maintain a list of events. In case of an SSR/PDR forcefully set these events. Change-Id: I83b4f576a65f8da5762288ac8dfccdef7d05d82a CRs-Fixed: 2045156
-rw-r--r--core/cds/src/cds_api.c14
-rw-r--r--core/cds/src/cds_concurrency.c6
-rw-r--r--core/dp/txrx/ol_txrx.c2
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c6
-rw-r--r--core/hdd/src/wlan_hdd_driver_ops.c1
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c6
-rw-r--r--core/hdd/src/wlan_hdd_main.c10
-rw-r--r--core/hdd/src/wlan_hdd_wext.c13
-rw-r--r--core/mac/src/sys/common/src/wlan_qct_sys.c3
-rw-r--r--core/sap/src/sap_fsm.c5
-rw-r--r--core/wma/src/wma_data.c2
-rw-r--r--core/wma/src/wma_dev_if.c2
-rw-r--r--core/wma/src/wma_features.c14
-rw-r--r--core/wma/src/wma_main.c5
14 files changed, 49 insertions, 40 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c
index b674aea2ed7f..a563ae86da09 100644
--- a/core/cds/src/cds_api.c
+++ b/core/cds/src/cds_api.c
@@ -139,6 +139,7 @@ v_CONTEXT_t cds_init(void)
qdf_lock_stats_init();
qdf_mem_init();
qdf_mc_timer_manager_init();
+ qdf_event_list_init();
gp_cds_context = &g_cds_context;
@@ -188,6 +189,7 @@ void cds_deinit(void)
qdf_mem_exit();
qdf_lock_stats_deinit();
qdf_debugfs_exit();
+ qdf_event_list_destroy();
gp_cds_context->qdf_ctx = NULL;
gp_cds_context = NULL;
@@ -651,8 +653,9 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context)
}
/* Need to update time out of complete */
- qdf_status = qdf_wait_single_event(&gp_cds_context->wmaCompleteEvent,
- CDS_WMA_TIMEOUT);
+ qdf_status = qdf_wait_for_event_completion(
+ &gp_cds_context->wmaCompleteEvent,
+ CDS_WMA_TIMEOUT);
if (qdf_status != QDF_STATUS_SUCCESS) {
if (qdf_status == QDF_STATUS_E_TIMEOUT) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
@@ -806,8 +809,9 @@ err_wma_stop:
wma_setneedshutdown(cds_context);
} else {
qdf_status =
- qdf_wait_single_event(&(gp_cds_context->wmaCompleteEvent),
- CDS_WMA_TIMEOUT);
+ qdf_wait_for_event_completion(
+ &gp_cds_context->wmaCompleteEvent,
+ CDS_WMA_TIMEOUT);
if (qdf_status != QDF_STATUS_SUCCESS) {
if (qdf_status == QDF_STATUS_E_TIMEOUT) {
QDF_TRACE(QDF_MODULE_ID_QDF,
@@ -1840,7 +1844,7 @@ static QDF_STATUS cds_force_assert_target(qdf_device_t qdf_ctx)
}
/* wait for firmware assert to trigger a recovery event */
- status = qdf_wait_single_event(&wma->recovery_event,
+ status = qdf_wait_for_event_completion(&wma->recovery_event,
WMA_CRASH_INJECT_TIMEOUT);
if (QDF_IS_STATUS_ERROR(status)) {
cds_err("Failed target force assert wait; status:%d", status);
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index 264ade9864cd..2b3365cb4f66 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -8373,7 +8373,7 @@ void cds_restart_sap(hdd_adapter_t *ap_adapter)
qdf_event_reset(&hostapd_state->qdf_stop_bss_event);
if (QDF_STATUS_SUCCESS == wlansap_stop_bss(sap_ctx)) {
qdf_status =
- qdf_wait_single_event(&hostapd_state->
+ qdf_wait_for_event_completion(&hostapd_state->
qdf_stop_bss_event,
SME_CMD_TIMEOUT_VALUE);
@@ -8406,7 +8406,7 @@ void cds_restart_sap(hdd_adapter_t *ap_adapter)
cds_debug("Waiting for SAP to start");
qdf_status =
- qdf_wait_single_event(&hostapd_state->qdf_event,
+ qdf_wait_for_event_completion(&hostapd_state->qdf_event,
SME_CMD_TIMEOUT_VALUE);
wlansap_reset_sap_config_add_ie(sap_config,
eUPDATE_IE_ALL);
@@ -8840,7 +8840,7 @@ QDF_STATUS qdf_wait_for_connection_update(void)
return QDF_STATUS_E_FAILURE;
}
- status = qdf_wait_single_event(
+ status = qdf_wait_for_event_completion(
&cds_context->connection_update_done_evt,
CONNECTION_UPDATE_TIMEOUT);
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c
index d97b0f2a692d..2e0da9a5115d 100644
--- a/core/dp/txrx/ol_txrx.c
+++ b/core/dp/txrx/ol_txrx.c
@@ -2523,7 +2523,7 @@ ol_txrx_peer_attach(ol_txrx_vdev_handle vdev, uint8_t *peer_mac_addr)
sizeof(union ol_txrx_align_mac_addr_t));
if (wait_on_deletion) {
/* wait for peer deletion */
- rc = qdf_wait_single_event(&vdev->wait_delete_comp,
+ rc = qdf_wait_for_event_completion(&vdev->wait_delete_comp,
PEER_DELETION_TIMEOUT);
if (QDF_STATUS_SUCCESS != rc) {
ol_txrx_err(
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 199ae22fb7be..9576381fccb7 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -15249,7 +15249,7 @@ static bool wlan_hdd_handle_sap_sta_dfs_conc(hdd_adapter_t *adapter,
* machine from disconnected to started and set this event.
* wait for 10 secs to finish this.
*/
- status = qdf_wait_single_event(&hostapd_state->qdf_event, 10000);
+ status = qdf_wait_for_event_completion(&hostapd_state->qdf_event, 10000);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("wait for qdf_event failed, STA not allowed!!");
return false;
@@ -18098,7 +18098,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
pAdapter->aStaInfo[i].
isDeauthInProgress = true;
qdf_status =
- qdf_wait_single_event(
+ qdf_wait_for_event_completion(
&hapd_state->
qdf_sta_disassoc_event,
SME_CMD_TIMEOUT_VALUE);
@@ -18165,7 +18165,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
MAC_ADDR_ARRAY(mac));
return -ENOENT;
}
- qdf_status = qdf_wait_single_event(
+ qdf_status = qdf_wait_for_event_completion(
&hapd_state->
qdf_sta_disassoc_event,
SME_CMD_TIMEOUT_VALUE);
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c
index ac13fdce647b..e0b55dcea977 100644
--- a/core/hdd/src/wlan_hdd_driver_ops.c
+++ b/core/hdd/src/wlan_hdd_driver_ops.c
@@ -1336,6 +1336,7 @@ static void hdd_cleanup_on_fw_down(void)
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
cds_set_fw_state(CDS_FW_STATE_DOWN);
+ qdf_complete_wait_events();
cds_set_target_ready(false);
if (hdd_ctx != NULL)
hdd_cleanup_scan_queue(hdd_ctx, NULL);
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index f8c42217b74f..8f690df73ca5 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -5344,7 +5344,7 @@ __iw_softap_stopbss(struct net_device *dev,
WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
if (QDF_IS_STATUS_SUCCESS(status)) {
qdf_status =
- qdf_wait_single_event(&pHostapdState->
+ qdf_wait_for_event_completion(&pHostapdState->
qdf_stop_bss_event,
SME_CMD_TIMEOUT_VALUE);
@@ -8398,7 +8398,7 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
hdd_debug("Waiting for Scan to complete(auto mode) and BSS to start");
- qdf_status = qdf_wait_single_event(&pHostapdState->qdf_event,
+ qdf_status = qdf_wait_for_event_completion(&pHostapdState->qdf_event,
SME_CMD_TIMEOUT_VALUE);
wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_ALL);
@@ -8611,7 +8611,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
status = wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter));
if (QDF_IS_STATUS_SUCCESS(status)) {
qdf_status =
- qdf_wait_single_event(&pHostapdState->
+ qdf_wait_for_event_completion(&pHostapdState->
qdf_stop_bss_event,
SME_CMD_TIMEOUT_VALUE);
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index c4dc0015a0ee..404c2ec5ca86 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -4270,8 +4270,8 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
qdf_event_reset(&hostapd_state->
qdf_stop_bss_event);
qdf_status =
- qdf_wait_single_event(&hostapd_state->
- qdf_stop_bss_event,
+ qdf_wait_for_event_completion(
+ &hostapd_state->qdf_stop_bss_event,
SME_CMD_TIMEOUT_VALUE);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
@@ -11174,8 +11174,8 @@ void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter)
qdf_event_reset(&hostapd_state->qdf_stop_bss_event);
if (QDF_STATUS_SUCCESS == wlansap_stop_bss(hdd_ap_ctx->
sapContext)) {
- qdf_status = qdf_wait_single_event(&hostapd_state->
- qdf_stop_bss_event,
+ qdf_status = qdf_wait_for_event_completion(
+ &hostapd_state->qdf_stop_bss_event,
SME_CMD_TIMEOUT_VALUE);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
mutex_unlock(&hdd_ctx->sap_lock);
@@ -11242,7 +11242,7 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter, bool reinit)
goto end;
hdd_debug("Waiting for SAP to start");
- qdf_status = qdf_wait_single_event(&hostapd_state->qdf_event,
+ qdf_status = qdf_wait_for_event_completion(&hostapd_state->qdf_event,
SME_CMD_TIMEOUT_VALUE);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
hdd_err("SAP Start failed");
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index dc22a31824d4..2f2d9ccd0b4f 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -5091,9 +5091,9 @@ static int __iw_get_bitrate(struct net_device *dev,
pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
- qdf_status =
- qdf_wait_single_event(&pWextState->hdd_qdf_event,
- WLAN_WAIT_TIME_STATS);
+ qdf_status = qdf_wait_for_event_completion(
+ &pWextState->hdd_qdf_event,
+ WLAN_WAIT_TIME_STATS);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
hdd_err("SME timeout while retrieving statistics");
@@ -11894,9 +11894,10 @@ static int __iw_get_statistics(struct net_device *dev,
pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
- qdf_status =
- qdf_wait_single_event(&pWextState->hdd_qdf_event,
- WLAN_WAIT_TIME_STATS);
+ qdf_status = qdf_wait_for_event_completion(
+ &pWextState->hdd_qdf_event,
+ WLAN_WAIT_TIME_STATS);
+
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
hdd_err("SME timeout while retrieving statistics");
/* Remove the SME statistics list by
diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c
index 56404085797b..1693ecc050a7 100644
--- a/core/mac/src/sys/common/src/wlan_qct_sys.c
+++ b/core/mac/src/sys/common/src/wlan_qct_sys.c
@@ -120,7 +120,8 @@ QDF_STATUS sys_stop(v_CONTEXT_t p_cds_context)
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
qdf_status = QDF_STATUS_E_BADMSG;
- qdf_status = qdf_wait_single_event(&g_stop_evt, SYS_STOP_TIMEOUT);
+ qdf_status = qdf_wait_for_event_completion(&g_stop_evt,
+ SYS_STOP_TIMEOUT);
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
qdf_status = qdf_event_destroy(&g_stop_evt);
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index d196eb1144b7..8131ed3678cc 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -2651,8 +2651,9 @@ QDF_STATUS sap_open_session(tHalHandle hHal, ptSapContext sapContext,
return QDF_STATUS_E_FAILURE;
}
- status = qdf_wait_single_event(&sapContext->sap_session_opened_evt,
- SME_CMD_TIMEOUT_VALUE);
+ status = qdf_wait_for_event_completion(
+ &sapContext->sap_session_opened_evt,
+ SME_CMD_TIMEOUT_VALUE);
if (!QDF_IS_STATUS_SUCCESS(status)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c
index 57b0a6319022..5bc0299eb0e4 100644
--- a/core/wma/src/wma_data.c
+++ b/core/wma/src/wma_data.c
@@ -3035,7 +3035,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
* @ Discrete : Target Download Complete
*/
qdf_status =
- qdf_wait_single_event(&wma_handle->
+ qdf_wait_for_event_completion(&wma_handle->
tx_frm_download_comp_event,
WMA_TX_FRAME_COMPLETE_TIMEOUT);
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 30ede24ace20..4cd36452825c 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -5151,7 +5151,7 @@ static void wma_wait_tx_complete(tp_wma_handle wma,
while (ol_txrx_get_tx_pending(pdev) && max_wait_iterations) {
WMA_LOGW(FL("Waiting for outstanding packet to drain."));
- qdf_wait_single_event(&wma->tx_queue_empty_event,
+ qdf_wait_for_event_completion(&wma->tx_queue_empty_event,
WMA_TX_Q_RECHECK_TIMER_WAIT);
max_wait_iterations--;
}
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c
index ef212ebbc901..27038ea88626 100644
--- a/core/wma/src/wma_features.c
+++ b/core/wma/src/wma_features.c
@@ -5519,7 +5519,7 @@ QDF_STATUS wma_enable_d0wow_in_fw(WMA_HANDLE handle)
return status;
}
- status = qdf_wait_single_event(&wma->target_suspend,
+ status = qdf_wait_for_event_completion(&wma->target_suspend,
WMA_TGT_SUSPEND_COMPLETE_TIMEOUT);
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE("Failed to receive D0-WoW enable HTC ACK from FW! "
@@ -5619,7 +5619,7 @@ QDF_STATUS wma_enable_wow_in_fw(WMA_HANDLE handle, uint32_t wow_flags)
wmi_set_target_suspend(wma->wmi_handle, true);
- if (qdf_wait_single_event(&wma->target_suspend,
+ if (qdf_wait_for_event_completion(&wma->target_suspend,
WMA_TGT_SUSPEND_COMPLETE_TIMEOUT)
!= QDF_STATUS_SUCCESS) {
WMA_LOGE("Failed to receive WoW Enable Ack from FW");
@@ -6382,7 +6382,7 @@ static QDF_STATUS wma_send_host_wakeup_ind_to_fw(tp_wma_handle wma)
WMA_LOGD("Host wakeup indication sent to fw");
- qdf_status = qdf_wait_single_event(&(wma->wma_resume_event),
+ qdf_status = qdf_wait_for_event_completion(&(wma->wma_resume_event),
WMA_RESUME_TIMEOUT);
if (QDF_STATUS_SUCCESS != qdf_status) {
WMA_LOGP("%s: Timeout waiting for resume event from FW",
@@ -6438,7 +6438,7 @@ QDF_STATUS wma_disable_d0wow_in_fw(WMA_HANDLE handle)
return status;
}
- status = qdf_wait_single_event(&(wma->wma_resume_event),
+ status = qdf_wait_for_event_completion(&(wma->wma_resume_event),
WMA_RESUME_TIMEOUT);
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGP("%s: Timeout waiting for resume event from FW!",
@@ -8346,7 +8346,7 @@ static QDF_STATUS wma_post_runtime_suspend_msg(WMA_HANDLE handle)
if (qdf_status != QDF_STATUS_SUCCESS)
goto failure;
- if (qdf_wait_single_event(&wma->runtime_suspend,
+ if (qdf_wait_for_event_completion(&wma->runtime_suspend,
WMA_TGT_SUSPEND_COMPLETE_TIMEOUT) !=
QDF_STATUS_SUCCESS) {
WMA_LOGE("Failed to get runtime suspend event");
@@ -8621,7 +8621,7 @@ QDF_STATUS wma_suspend_target(WMA_HANDLE handle, int disable_target_intr)
wmi_set_target_suspend(wma_handle->wmi_handle, true);
- if (qdf_wait_single_event(&wma_handle->target_suspend,
+ if (qdf_wait_for_event_completion(&wma_handle->target_suspend,
WMA_TGT_SUSPEND_COMPLETE_TIMEOUT)
!= QDF_STATUS_SUCCESS) {
WMA_LOGE("Failed to get ACK from firmware for pdev suspend");
@@ -8753,7 +8753,7 @@ QDF_STATUS wma_resume_target(WMA_HANDLE handle)
if (QDF_IS_STATUS_ERROR(qdf_status))
WMA_LOGE("Failed to send WMI_PDEV_RESUME_CMDID command");
- qdf_status = qdf_wait_single_event(&(wma->wma_resume_event),
+ qdf_status = qdf_wait_for_event_completion(&(wma->wma_resume_event),
WMA_RESUME_TIMEOUT);
if (QDF_STATUS_SUCCESS != qdf_status) {
WMA_LOGP("%s: Timeout waiting for resume event from FW",
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 78899f4cc882..ee9cb28c79be 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -6167,8 +6167,9 @@ QDF_STATUS wma_wait_for_ready_event(WMA_HANDLE handle)
QDF_STATUS qdf_status;
/* wait until WMI_READY_EVENTID received from FW */
- qdf_status = qdf_wait_single_event(&(wma_handle->wma_ready_event),
- WMA_READY_EVENTID_TIMEOUT);
+ qdf_status = qdf_wait_for_event_completion(
+ &wma_handle->wma_ready_event,
+ WMA_READY_EVENTID_TIMEOUT);
if (QDF_STATUS_SUCCESS != qdf_status) {
WMA_LOGE("%s: Timeout waiting for ready event from FW",