From 00676fd53ba9d7c72378416d3608fe189cc4fa03 Mon Sep 17 00:00:00 2001 From: Will Huang Date: Mon, 4 Jun 2018 14:24:33 +0800 Subject: [PATCH] qcacld-3.0: Resolve assert when sending D0WOW disable command Currently while sending wmi command when target is suspend, it will check whether command is WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID/ WMI_PDEV_RESUME_CMDID, but D0WOW command is an exception, to keep align with legacy code so don't set wmi_handle->is_target_suspended if it is D0WOW enable command. Move out logic of checking D0WOW status from PMO tgt to core layer. Change-Id: I164f24ea733e54e5e0dbdb77344917df5d039e53 CRs-Fixed: 2254047 --- pmo/core/src/wlan_pmo_suspend_resume.c | 13 ++++++++++++- pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c | 7 +------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pmo/core/src/wlan_pmo_suspend_resume.c b/pmo/core/src/wlan_pmo_suspend_resume.c index d4e6f0a84a..bfcedb4c59 100644 --- a/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/pmo/core/src/wlan_pmo_suspend_resume.c @@ -609,13 +609,24 @@ pmo_core_enable_wow_in_fw(struct wlan_objmgr_psoc *psoc, break; } + if (psoc_ctx->psoc_cfg.d0_wow_supported && + !psoc_ctx->caps.unified_wow && + !param.can_suspend_link) { + psoc_ctx->wow.wow_state = pmo_wow_state_legacy_d0; + } else if (param.can_suspend_link) { + psoc_ctx->wow.wow_state = pmo_wow_state_unified_d3; + } else { + psoc_ctx->wow.wow_state = pmo_wow_state_unified_d0; + } + status = pmo_tgt_psoc_send_wow_enable_req(psoc, ¶m); if (status != QDF_STATUS_SUCCESS) { pmo_err("Failed to enable wow in fw"); goto out; } - pmo_tgt_update_target_suspend_flag(psoc, true); + if (psoc_ctx->wow.wow_state != pmo_wow_state_legacy_d0) + pmo_tgt_update_target_suspend_flag(psoc, true); status = qdf_wait_for_event_completion(&psoc_ctx->wow.target_suspend, PMO_TARGET_SUSPEND_TIMEOUT); diff --git a/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c b/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c index ff6eb5ccdc..c54a778a7a 100644 --- a/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c +++ b/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c @@ -140,14 +140,11 @@ QDF_STATUS pmo_tgt_psoc_send_wow_enable_req(struct wlan_objmgr_psoc *psoc, psoc_ctx = pmo_psoc_get_priv(psoc); pmo_tx_ops = GET_PMO_TX_OPS_FROM_PSOC(psoc); - if (psoc_ctx->psoc_cfg.d0_wow_supported && - !psoc_ctx->caps.unified_wow && - !param->can_suspend_link) { + if (psoc_ctx->wow.wow_state == pmo_wow_state_legacy_d0) { if (!pmo_tx_ops.psoc_send_d0wow_enable_req) { pmo_err("psoc_send_d0wow_enable_req is null"); return QDF_STATUS_E_NULL_VALUE; } - psoc_ctx->wow.wow_state = pmo_wow_state_legacy_d0; pmo_debug("Sending D0WOW enable command..."); return pmo_tx_ops.psoc_send_d0wow_enable_req(psoc); } @@ -156,8 +153,6 @@ QDF_STATUS pmo_tgt_psoc_send_wow_enable_req(struct wlan_objmgr_psoc *psoc, pmo_err("psoc_send_wow_enable_req is null"); return QDF_STATUS_E_NULL_VALUE; } - psoc_ctx->wow.wow_state = param->can_suspend_link ? - pmo_wow_state_unified_d3 : pmo_wow_state_unified_d0; return pmo_tx_ops.psoc_send_wow_enable_req(psoc, param); }