From ed682c0d9df98053b0aa3ccd1fac03a863883611 Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Tue, 9 Feb 2021 14:10:10 +0800 Subject: [PATCH] qcacld-3.0: Add detection for tasklet delay This is to enable feature for detection CE tasklet scheduling delay and credit response delay issue. Change-Id: I659aa23eabaa28bfb11051bf15e0343c94061b86 CRs-Fixed: 2874867 --- Kbuild | 8 ++++++++ .../pmo/core/src/wlan_pmo_suspend_resume.c | 4 ++++ configs/default_defconfig | 1 + core/hdd/inc/wlan_hdd_driver_ops.h | 16 ++++++++++++++++ core/hdd/src/wlan_hdd_driver_ops.c | 7 +++++++ core/hdd/src/wlan_hdd_main.c | 1 + 6 files changed, 37 insertions(+) diff --git a/Kbuild b/Kbuild index 441ee43ec19c..6e44f69c1efe 100644 --- a/Kbuild +++ b/Kbuild @@ -3734,6 +3734,14 @@ cppflags-$(CONFIG_DP_FT_LOCK_HISTORY) += -DDP_FT_LOCK_HISTORY ccflags-$(CONFIG_GET_DRIVER_MODE) += -DFEATURE_GET_DRIVER_MODE +ifeq ($(CONFIG_SMP), y) +ifeq ($(CONFIG_HIF_DETECTION_LATENCY_ENABLE), y) +cppflags-y += -DHIF_DETECTION_LATENCY_ENABLE +cppflags-y += -DDETECTION_TIMER_TIMEOUT=2000 +cppflags-y += -DDETECTION_LATENCY_THRESHOLD=1900 +endif +endif + KBUILD_CPPFLAGS += $(cppflags-y) # Currently, for versions of gcc which support it, the kernel Makefile diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index c680350bea74..8c1023bad311 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -862,6 +862,8 @@ pmo_core_enable_wow_in_fw(struct wlan_objmgr_psoc *psoc, pmo_debug("WOW enabled successfully in fw: credits:%d pending_cmds: %d", host_credits, wmi_pending_cmds); + hif_latency_detect_timer_stop(pmo_core_psoc_get_hif_handle(psoc)); + pmo_core_update_wow_enable_cmd_sent(psoc_ctx, true); out: @@ -1448,6 +1450,8 @@ QDF_STATUS pmo_core_psoc_bus_resume_req(struct wlan_objmgr_psoc *psoc, goto out; } + hif_latency_detect_timer_start(pmo_core_psoc_get_hif_handle(psoc)); + psoc_ctx = pmo_psoc_get_priv(psoc); wow_mode = pmo_core_is_wow_enabled(psoc_ctx); pmo_debug("wow mode %d", wow_mode); diff --git a/configs/default_defconfig b/configs/default_defconfig index d968b53be496..a56d35ded91e 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -1037,6 +1037,7 @@ ifeq ($(CONFIG_SLUB_DEBUG_ON), y) CONFIG_UNIT_TEST := y CONFIG_REGISTER_OP_DEBUG := y CONFIG_ENABLE_QDF_PTR_HASH_DEBUG := y + CONFIG_HIF_DETECTION_LATENCY_ENABLE := y endif ifeq ($(CONFIG_UNIT_TEST), y) diff --git a/core/hdd/inc/wlan_hdd_driver_ops.h b/core/hdd/inc/wlan_hdd_driver_ops.h index 976f67c55d4a..a582f9a6edfe 100644 --- a/core/hdd/inc/wlan_hdd_driver_ops.h +++ b/core/hdd/inc/wlan_hdd_driver_ops.h @@ -155,4 +155,20 @@ void hdd_set_hif_init_phase(struct hif_opaque_softc *hif_ctx, { } #endif /* FORCE_WAKE */ + +#ifdef HIF_DETECTION_LATENCY_ENABLE +/** + * hdd_hif_set_enable_detection() - enable detection + * @hif_ctx: hif opaque handle + * @value: enable/disable + * + * Return: None + */ +void hdd_hif_set_enable_detection(struct hif_opaque_softc *hif_ctx, bool value); +#else +static inline +void hdd_hif_set_enable_detection(struct hif_opaque_softc *hif_ctx, bool value) +{ +} +#endif /* HIF_DETECTION_LATENCY_ENABLE */ #endif /* __WLAN_HDD_DRIVER_OPS_H__ */ diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 51070d12a500..73e9e25b1d4e 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -230,6 +230,13 @@ static void hdd_hif_init_driver_state_callbacks(void *data, hdd_put_consistent_mem_unaligned; } +#ifdef HIF_DETECTION_LATENCY_ENABLE +void hdd_hif_set_enable_detection(struct hif_opaque_softc *hif_ctx, bool value) +{ + hif_set_enable_detection(hif_ctx, value); +} +#endif + #ifdef FORCE_WAKE void hdd_set_hif_init_phase(struct hif_opaque_softc *hif_ctx, bool hal_init_phase) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 6096f099b87b..fe69e346b88b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4091,6 +4091,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) wlan_hdd_init_tx_rx_histogram(hdd_ctx); hdd_set_hif_init_phase(hif_ctx, false); + hdd_hif_set_enable_detection(hif_ctx, true); break;