From 50b60da282d1941140d126d6bf3a3c0a430aa4f3 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 8 Aug 2019 23:13:14 -0700 Subject: [PATCH] qcacld-3.0: Enable HW filters in runtime pm mode Enable hw filter in runtime pm mode such that target CPU wake ups can be avoided in order to achieve max power savings. Change-Id: I97aa26b063e70db5e3023faf6aa40cc53bfac3af CRs-Fixed: 2502744 --- components/pmo/core/src/wlan_pmo_hw_filter.c | 2 ++ .../pmo/core/src/wlan_pmo_suspend_resume.c | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/components/pmo/core/src/wlan_pmo_hw_filter.c b/components/pmo/core/src/wlan_pmo_hw_filter.c index 9900c6e97704..328872a3ac1c 100644 --- a/components/pmo/core/src/wlan_pmo_hw_filter.c +++ b/components/pmo/core/src/wlan_pmo_hw_filter.c @@ -41,6 +41,7 @@ QDF_STATUS pmo_core_enable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev) if (wlan_vdev_is_up(vdev) != QDF_STATUS_SUCCESS) { status = QDF_STATUS_E_NOSUPPORT; + pmo_vdev_put_ref(vdev); goto exit_with_status; } @@ -77,6 +78,7 @@ QDF_STATUS pmo_core_disable_hw_filter_in_fwr(struct wlan_objmgr_vdev *vdev) if (wlan_vdev_is_up(vdev) != QDF_STATUS_SUCCESS) { status = QDF_STATUS_E_NOSUPPORT; + pmo_vdev_put_ref(vdev); goto exit_with_status; } diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index b741923824ba..cee7ee8ec5b8 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -25,6 +25,7 @@ #include "wlan_pmo_main.h" #include "wlan_pmo_obj_mgmt_public_struct.h" #include "wlan_pmo_lphb.h" +#include "wlan_pmo_hw_filter.h" #include "wlan_pmo_suspend_resume.h" #include "cdp_txrx_ops.h" #include "cdp_txrx_misc.h" @@ -427,6 +428,34 @@ void pmo_core_configure_dynamic_wake_events(struct wlan_objmgr_psoc *psoc) } +static void pmo_core_enable_runtime_pm_offloads(struct wlan_objmgr_psoc *psoc) +{ + uint8_t vdev_id; + struct wlan_objmgr_vdev *vdev; + + /* Iterate through VDEV list */ + for (vdev_id = 0; vdev_id < WLAN_UMAC_PSOC_MAX_VDEVS; vdev_id++) { + vdev = pmo_psoc_get_vdev(psoc, vdev_id); + if (!vdev) + continue; + pmo_core_enable_hw_filter_in_fwr(vdev); + } +} + +static void pmo_core_disable_runtime_pm_offloads(struct wlan_objmgr_psoc *psoc) +{ + uint8_t vdev_id; + struct wlan_objmgr_vdev *vdev; + + /* Iterate through VDEV list */ + for (vdev_id = 0; vdev_id < WLAN_UMAC_PSOC_MAX_VDEVS; vdev_id++) { + vdev = pmo_psoc_get_vdev(psoc, vdev_id); + if (!vdev) + continue; + pmo_core_disable_hw_filter_in_fwr(vdev); + } +} + /** * pmo_core_psoc_configure_suspend(): configure suspend req events * @psoc: objmgr psoc @@ -445,6 +474,9 @@ static QDF_STATUS pmo_core_psoc_configure_suspend(struct wlan_objmgr_psoc *psoc, psoc_ctx = pmo_psoc_get_priv(psoc); + if (is_runtime_pm) + pmo_core_enable_runtime_pm_offloads(psoc); + if (pmo_core_is_wow_applicable(psoc)) { pmo_debug("WOW Suspend"); pmo_core_apply_lphb(psoc); @@ -651,6 +683,8 @@ static QDF_STATUS pmo_core_psoc_configure_resume(struct wlan_objmgr_psoc *psoc, pmo_enter(); psoc_ctx = pmo_psoc_get_priv(psoc); + if (is_runtime_pm) + pmo_core_disable_runtime_pm_offloads(psoc); /* * For runtime PM, since system is awake, DTIM related commands