diff options
| author | Komal Seelam <kseelam@qti.qualcomm.com> | 2014-08-01 11:39:54 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-08-02 00:34:01 -0700 |
| commit | c8c8896cc3a202b4294cee662963cdf94cda257b (patch) | |
| tree | acfa651c3f845291c59ea2986f5fef90bbe8bc0c | |
| parent | 2308297ce487c0afc8bdd64a3825462637d46e8a (diff) | |
qcacld: Start HTC ACK timer after TX complete of wow_enable command
During Stress tests, HTC ACK is recieved to host after 1sec as the
WOW_ENABLE is pending in the HTC queue nearly for one sec,
where the ACK timer expired in the host and the suspend failed.
Fix by waiting for TX complete before starting HTC ACK 1sec timer.
Change-Id: I411adafb819b91e3e30504f1238367c659902c40
CRs-Fixed: 703573
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_unified_api.h | 6 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 28 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMI/wmi_unified.c | 5 | ||||
| -rw-r--r-- | CORE/SERVICES/WMI/wmi_unified_priv.h | 1 |
5 files changed, 39 insertions, 3 deletions
diff --git a/CORE/SERVICES/COMMON/wmi_unified_api.h b/CORE/SERVICES/COMMON/wmi_unified_api.h index 4ae0bdc1b932..62797d90a575 100644 --- a/CORE/SERVICES/COMMON/wmi_unified_api.h +++ b/CORE/SERVICES/COMMON/wmi_unified_api.h @@ -48,7 +48,7 @@ typedef adf_nbuf_t wmi_buf_t; * @return opaque handle. */ void * -wmi_unified_attach(void *scn_handle); +wmi_unified_attach(void *scn_handle, void (*func) (void*)); /** * detach for unified WMI * @@ -146,4 +146,8 @@ wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val); void wmi_set_d0wow_flag(wmi_unified_t wmi_handle, A_BOOL flag); #endif +/** + WMA Callback to get the Tx complete for WOW_ENABLE +*/ +typedef void (*wma_wow_tx_complete_cbk)(void *scn_handle); #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 31242689605f..501cfabe14fc 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -4681,6 +4681,13 @@ wma_register_extscan_event_handler(tp_wma_handle wma_handle) return; } +void wma_wow_tx_complete(void *wma) +{ + tp_wma_handle wma_handle = (tp_wma_handle)wma; + WMA_LOGD("WOW_TX_COMPLETE DONE"); + vos_event_set(&wma_handle->wow_tx_complete); +} + /* * Allocate and init wmi adaptation layer. */ @@ -4728,7 +4735,7 @@ VOS_STATUS WDA_open(v_VOID_t *vos_context, v_VOID_t *os_ctx, } /* attach the wmi */ - wmi_handle = wmi_unified_attach(wma_handle); + wmi_handle = wmi_unified_attach(wma_handle, wma_wow_tx_complete); if (!wmi_handle) { WMA_LOGP("%s: failed to attach WMI", __func__); vos_status = VOS_STATUS_E_NOMEM; @@ -4880,6 +4887,13 @@ VOS_STATUS WDA_open(v_VOID_t *vos_context, v_VOID_t *os_ctx, goto err_event_init; } + vos_status = vos_event_init(&wma_handle->wow_tx_complete); + if (vos_status != VOS_STATUS_SUCCESS) { + WMA_LOGP("%s: wow_tx_complete event initialization failed", + __func__); + goto err_event_init; + } + /* Init Tx Frame Complete event */ vos_status = vos_event_init(&wma_handle->tx_frm_download_comp_event); if (!VOS_IS_STATUS_SUCCESS(vos_status)) { @@ -16324,6 +16338,7 @@ int wma_enable_wow_in_fw(WMA_HANDLE handle) cmd->enable = TRUE; vos_event_reset(&wma->target_suspend); + vos_event_reset(&wma->wow_tx_complete); wma->wow_nack = 0; host_credits = wmi_get_host_credits(wma->wmi_handle); @@ -16346,6 +16361,16 @@ int wma_enable_wow_in_fw(WMA_HANDLE handle) goto error; } + if (vos_wait_single_event(&wma->wow_tx_complete, + WMA_TGT_WOW_TX_COMPLETE_TIMEOUT) + != VOS_STATUS_SUCCESS) { + WMA_LOGE("FAILED TO RECIEVE TX COMPLETE FOR WOW"); + WMA_LOGE("Credits:%d; Pending_Cmds:%d", + wmi_get_host_credits(wma->wmi_handle), + wmi_get_pending_cmds(wma->wmi_handle)); + VOS_BUG(0); + } + wmi_set_target_suspend(wma->wmi_handle, TRUE); if (vos_wait_single_event(&wma->target_suspend, @@ -22879,6 +22904,7 @@ VOS_STATUS wma_close(v_VOID_t *vos_ctx) vos_event_destroy(&wma_handle->wma_ready_event); vos_event_destroy(&wma_handle->target_suspend); vos_event_destroy(&wma_handle->wma_resume_event); + vos_event_destroy(&wma_handle->wow_tx_complete); wma_cleanup_vdev_resp(wma_handle); #ifdef QCA_WIFI_ISOC vos_event_destroy(&wma_handle->cfg_nv_tx_complete); diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index c676eb8ada52..248e645e21bd 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -81,6 +81,7 @@ #define WMA_WAKE_LOCK_TIMEOUT 1000 #define WMA_MAX_RESUME_RETRY 1000 #define WMA_RESUME_TIMEOUT 3000 +#define WMA_TGT_WOW_TX_COMPLETE_TIMEOUT 2000 #define MAX_MEM_CHUNKS 32 /* In prima 12 HW stations are supported including BCAST STA(staId 0) @@ -554,6 +555,7 @@ typedef struct { vos_event_t wma_ready_event; vos_event_t wma_resume_event; vos_event_t target_suspend; + vos_event_t wow_tx_complete; t_cfg_nv_param cfg_nv; v_U16_t max_station; diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index fdb441d9064f..ab51a641231f 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -946,7 +946,7 @@ void wmi_rx_event_work(struct work_struct *work) /* WMI Initialization functions */ void * -wmi_unified_attach(ol_scn_t scn_handle) +wmi_unified_attach(ol_scn_t scn_handle, wma_wow_tx_complete_cbk func) { struct wmi_unified *wmi_handle; wmi_handle = (struct wmi_unified *)OS_MALLOC(NULL, sizeof(struct wmi_unified), GFP_ATOMIC); @@ -970,6 +970,7 @@ wmi_unified_attach(ol_scn_t scn_handle) #ifdef WMI_INTERFACE_EVENT_LOGGING adf_os_spinlock_init(&wmi_handle->wmi_record_lock); #endif + wmi_handle->wma_wow_tx_complete_cbk = func; return wmi_handle; } @@ -1013,6 +1014,8 @@ void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt) ((u_int32_t *)adf_nbuf_data(wmi_cmd_buf) + 2)); adf_os_spin_unlock_bh(&wmi_handle->wmi_record_lock); #endif + if (cmd_id == WMI_WOW_ENABLE_CMDID) + wmi_handle->wma_wow_tx_complete_cbk(wmi_handle->scn_handle); adf_nbuf_free(wmi_cmd_buf); adf_os_mem_free(htc_pkt); adf_os_atomic_dec(&wmi_handle->pending_cmds); diff --git a/CORE/SERVICES/WMI/wmi_unified_priv.h b/CORE/SERVICES/WMI/wmi_unified_priv.h index 692dafea36eb..c65b5ed5eed1 100644 --- a/CORE/SERVICES/WMI/wmi_unified_priv.h +++ b/CORE/SERVICES/WMI/wmi_unified_priv.h @@ -92,6 +92,7 @@ struct wmi_unified { #endif /*WMI_INTERFACE_EVENT_LOGGING*/ adf_os_atomic_t is_target_suspended; + void (*wma_wow_tx_complete_cbk)(ol_scn_t scn_handle); #ifdef FEATURE_WLAN_D0WOW A_BOOL in_d0wow; #endif |
