From 42853bf5ebcf760afafc910934260169d1fb5106 Mon Sep 17 00:00:00 2001 From: Nirav Shah Date: Tue, 11 Jan 2022 14:34:02 +0530 Subject: [PATCH] qcacld-3.0: Update latency flags to 64-bit configuration Update latency flags inis to 64-bit configuration and use lower 32-bit for firmware configuration and upper 32-bit as host configuration. Also remove separate inis for host latency flags. Change-Id: Iff62b847f40ae7fa5f82948ec37d756144860474 CRs-Fixed: 3115853 --- components/mlme/core/src/wlan_mlme_main.c | 67 +++- .../mlme/dispatcher/inc/cfg_mlme_fe_wlm.h | 297 ++++++------------ 2 files changed, 159 insertions(+), 205 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 5506e689c3..8ddfd0de5d 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -2243,21 +2243,64 @@ mlme_init_roam_score_config(struct wlan_objmgr_psoc *psoc, static void mlme_init_fe_wlm_in_cfg(struct wlan_objmgr_psoc *psoc, struct wlan_mlme_fe_wlm *wlm_config) { + uint64_t flags = 0; + QDF_STATUS status; + wlm_config->latency_enable = cfg_get(psoc, CFG_LATENCY_ENABLE); wlm_config->latency_reset = cfg_get(psoc, CFG_LATENCY_RESET); wlm_config->latency_level = cfg_get(psoc, CFG_LATENCY_LEVEL); - wlm_config->latency_flags[0] = cfg_get(psoc, CFG_LATENCY_FLAGS_NORMAL); - wlm_config->latency_flags[1] = cfg_get(psoc, CFG_LATENCY_FLAGS_MOD); - wlm_config->latency_flags[2] = cfg_get(psoc, CFG_LATENCY_FLAGS_LOW); - wlm_config->latency_flags[3] = cfg_get(psoc, CFG_LATENCY_FLAGS_ULTLOW); - wlm_config->latency_host_flags[0] = - cfg_get(psoc, CFG_LATENCY_HOST_FLAGS_NORMAL); - wlm_config->latency_host_flags[1] = - cfg_get(psoc, CFG_LATENCY_HOST_FLAGS_MOD); - wlm_config->latency_host_flags[2] = - cfg_get(psoc, CFG_LATENCY_HOST_FLAGS_LOW); - wlm_config->latency_host_flags[3] = - cfg_get(psoc, CFG_LATENCY_HOST_FLAGS_ULTLOW); + + status = qdf_uint64_parse(cfg_get(psoc, CFG_LATENCY_FLAGS_NORMAL), + &flags); + if (status != QDF_STATUS_SUCCESS) { + flags = 0; + mlme_legacy_err("normal latency flags parsing failed"); + } + + wlm_config->latency_flags[0] = flags & 0xFFFFFFFF; + wlm_config->latency_host_flags[0] = flags >> 32; + mlme_legacy_debug("normal latency flags 0x%x host flags 0x%x", + wlm_config->latency_flags[0], + wlm_config->latency_host_flags[0]); + + status = qdf_uint64_parse(cfg_get(psoc, CFG_LATENCY_FLAGS_MOD), + &flags); + if (status != QDF_STATUS_SUCCESS) { + flags = 0; + mlme_legacy_err("moderate latency flags parsing failed"); + } + + wlm_config->latency_flags[1] = flags & 0xFFFFFFFF; + wlm_config->latency_host_flags[1] = flags >> 32; + mlme_legacy_debug("moderate latency flags 0x%x host flags 0x%x", + wlm_config->latency_flags[1], + wlm_config->latency_host_flags[1]); + + status = qdf_uint64_parse(cfg_get(psoc, CFG_LATENCY_FLAGS_LOW), + &flags); + if (status != QDF_STATUS_SUCCESS) { + flags = 0; + mlme_legacy_err("low latency flags parsing failed"); + } + + wlm_config->latency_flags[2] = flags & 0xFFFFFFFF; + wlm_config->latency_host_flags[2] = flags >> 32; + mlme_legacy_debug("low latency flags 0x%x host flags 0x%x", + wlm_config->latency_flags[2], + wlm_config->latency_host_flags[2]); + + status = qdf_uint64_parse(cfg_get(psoc, CFG_LATENCY_FLAGS_ULTLOW), + &flags); + if (status != QDF_STATUS_SUCCESS) { + flags = 0; + mlme_legacy_err("ultra-low latency flags parsing failed"); + } + + wlm_config->latency_flags[3] = flags & 0xFFFFFFFF; + wlm_config->latency_host_flags[3] = flags >> 32; + mlme_legacy_debug("ultra-low latency flags 0x%x host flags 0x%x", + wlm_config->latency_flags[3], + wlm_config->latency_host_flags[3]); } /** diff --git a/components/mlme/dispatcher/inc/cfg_mlme_fe_wlm.h b/components/mlme/dispatcher/inc/cfg_mlme_fe_wlm.h index 8c841533ca..126e46636b 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_fe_wlm.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_fe_wlm.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -24,16 +25,17 @@ #define __CFG_MLME_FE_WLM_H /* - * |31 18| 17 | 16 |15 8|7 2| 1 | 0 | - * +------+------+--------+-----------+------+----------+-----------+ - * | RSVD | HBB | PM-QOS | RSVD | RSVD | REO Ring | RX Thread | - * +------+------+--------+-----------+------+----------+-----------+ - * | common | TX Path | RX Path | + * Flag definition of 32-bit host latency flags + * + * |31 18| 17 | 16 |15 8|7 1| 0 | + * +------+------+--------+-----------+------+-----------+ + * | RSVD | HBB | PM-QOS | RSVD | RSVD | RX Thread | + * +------+------+--------+-----------+------+-----------+ + * | common | TX Path | RX Path | * * bit 0-7: Rx path related optimization * bit 0: disable rx_thread for vdev - * bit 1: Reduce REO ring timer threshold to 32us(applicable for all REO ring) - * bit 2-7: Reserved + * bit 1-7: Reserved * bit 8-15: Tx path related optimization * bit 8-15: Reserved * bit 16-31: common changes @@ -42,10 +44,11 @@ */ #define WLM_HOST_RX_THREAD_FLAG (1 << 0) -#define WLM_HOST_REO_RING_FLAG (1 << 1) #define WLM_HOST_PM_QOS_FLAG (1 << 16) #define WLM_HOST_HBB_FLAG (1 << 17) +#define CFG_MAX_LATENCY_FLAGS "0xFFFFFFFFFFFFFFFF" + /* * * wlm_latency_enable - WLM latency Enable @@ -108,7 +111,7 @@ * wlm_latency_flags_normal - WLM flags setting for normal level * * @min: 0x0 - * @max: 0xffffffff + * @max: 0xffffffffffffffff * @default: 0x0 * * |31 12| 11 | 10 |9 8|7 6|5 4|3 2| 1 | 0 | @@ -137,21 +140,38 @@ * bit 11: Disable sys sleep if setting * bit 12-31: Reserve for future useage * + * |63 50| 49 | 48 |47 40|39 33| 32 | + * +------+------+--------+------------+-------+-----------+ + * | RSVD | HBB | PM-QOS | RSVD | RSVD | RX Thread | + * +------+------+--------+------------+-------+-----------+ + * | common | TX Path | RX Path | + * + * bit 39-32: Rx path related optimization + * bit 32: disable rx_thread for vdev + * bit 33-39: Reserved + * bit 40-47: Tx path related optimization + * bit 40-47: Reserved + * bit 48-63: common changes + * bit 48: Request for pm_qos vote + * bit 49: Request for high ddr bus bandwidth + * * */ -#define CFG_LATENCY_FLAGS_NORMAL CFG_INI_UINT("wlm_latency_flags_normal", \ - 0, \ - 0xffffffff, \ - 0, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM flag setting for normal lvl") +#define CFG_DEFAULT_NORMAL_FLAGS "0x0" +#define CFG_LATENCY_FLAGS_NORMAL \ + CFG_INI_STRING("wlm_latency_flags_normal",\ + 0, \ + sizeof(CFG_MAX_LATENCY_FLAGS) - 1,\ + CFG_DEFAULT_NORMAL_FLAGS, \ + "WLM flags for normal level") + /* * * wlm_latency_flags_moderate - WLM flags setting for moderate level * * @min: 0x0 - * @max: 0xffffffff + * @max: 0xffffffffffffffff * @default: 0x8 * * |31 12| 11 | 10 |9 8|7 6|5 4|3 2| 1 | 0 | @@ -180,21 +200,38 @@ * bit 11: Disable sys sleep if setting * bit 12-31: Reserve for future useage * + * |63 50| 49 | 48 |47 40|39 33| 32 | + * +------+------+--------+------------+-------+-----------+ + * | RSVD | HBB | PM-QOS | RSVD | RSVD | RX Thread | + * +------+------+--------+------------+-------+-----------+ + * | common | TX Path | RX Path | + * + * bit 39-32: Rx path related optimization + * bit 32: disable rx_thread for vdev + * bit 33-39: Reserved + * bit 40-47: Tx path related optimization + * bit 40-47: Reserved + * bit 48-63: common changes + * bit 48: Request for pm_qos vote + * bit 49: Request for high ddr bus bandwidth + * * */ -#define CFG_LATENCY_FLAGS_MOD CFG_INI_UINT("wlm_latency_flags_moderate", \ - 0, \ - 0xffffffff, \ - 0x8, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM flag setting for moderate lvl") +#define CFG_DEFAULT_MODERATE_FLAGS "0x8" +#define CFG_LATENCY_FLAGS_MOD \ + CFG_INI_STRING("wlm_latency_flags_moderate",\ + 0, \ + sizeof(CFG_MAX_LATENCY_FLAGS) - 1,\ + CFG_DEFAULT_MODERATE_FLAGS, \ + "WLM flags for moderate level") + /* * * wlm_latency_flags_low - WLM flags setting for low level * * @min: 0x0 - * @max: 0xffffffff + * @max: 0xffffffffffffffff * @default: 0xa * * |31 12| 11 | 10 |9 8|7 6|5 4|3 2| 1 | 0 | @@ -223,21 +260,37 @@ * bit 11: Disable sys sleep if setting * bit 12-31: Reserve for future useage * + * |63 50| 49 | 48 |47 40|39 33| 32 | + * +------+------+--------+------------+-------+-----------+ + * | RSVD | HBB | PM-QOS | RSVD | RSVD | RX Thread | + * +------+------+--------+------------+-------+-----------+ + * | common | TX Path | RX Path | + * + * bit 39-32: Rx path related optimization + * bit 32: disable rx_thread for vdev + * bit 33-39: Reserved + * bit 40-47: Tx path related optimization + * bit 40-47: Reserved + * bit 48-63: common changes + * bit 48: Request for pm_qos vote + * bit 49: Request for high ddr bus bandwidth + * * */ -#define CFG_LATENCY_FLAGS_LOW CFG_INI_UINT("wlm_latency_flags_low", \ - 0, \ - 0xffffffff, \ - 0xa, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM flags setting for low level") +#define CFG_DEFAULT_LOW_FLAGS "0xa" +#define CFG_LATENCY_FLAGS_LOW \ + CFG_INI_STRING("wlm_latency_flags_low",\ + 0, \ + sizeof(CFG_MAX_LATENCY_FLAGS) - 1,\ + CFG_DEFAULT_LOW_FLAGS, \ + "WLM flags for low level") /* * * wlm_latency_flags_ultralow - WLM flags setting for ultralow level * * @min: 0x0 - * @max: 0xffffffff + * @max: 0xffffffffffffffff * @default: 0xc83 * * |31 12| 11 | 10 |9 8|7 6|5 4|3 2| 1 | 0 | @@ -266,168 +319,30 @@ * bit 11: Disable sys sleep if setting * bit 12-31: Reserve for future useage * - * - */ -#define CFG_LATENCY_FLAGS_ULTLOW CFG_INI_UINT("wlm_latency_flags_ultralow",\ - 0, \ - 0xffffffff, \ - 0xc83, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM flags for ultralow level") - -/* - * - * wlm_latency_host_flags_normal - WLM Host flags setting for normal level + * |63 50| 49 | 48 |47 40|39 33| 32 | + * +------+------+--------+------------+-------+-----------+ + * | RSVD | HBB | PM-QOS | RSVD | RSVD | RX Thread | + * +------+------+--------+------------+-------+-----------+ + * | common | TX Path | RX Path | * - * @min: 0x0 - * @max: 0xffffffff - * @default: 0x0 - * - * This ini decides which host latency features gets enabled - * in normal latency mode. - * - * Usage: External - * - * |31 18| 17 | 16 |15 8|7 2| 1 | 0 | - * +------+------+--------+-----------+------+----------+-----------+ - * | RSVD | HBB | PM-QOS | RSVD | RSVD | REO Ring | RX Thread | - * +------+------+--------+-----------+------+----------+-----------+ - * | common | TX Path | RX Path | - * - * bit 0-7: Rx path related optimization - * bit 0: disable rx_thread for vdev - * bit 1: Reduce REO ring timer threshold to 32us(applicable for all REO ring) - * bit 2-7: Reserved - * bit 8-15: Tx path related optimization - * bit 8-15: Reserved - * bit 16-31: common changes - * bit 16: Request for pm_qos vote - * bit 17: Request for high ddr bus bandwidth + * bit 39-32: Rx path related optimization + * bit 32: disable rx_thread for vdev + * bit 33-39: Reserved + * bit 40-47: Tx path related optimization + * bit 40-47: Reserved + * bit 48-63: common changes + * bit 48: Request for pm_qos vote + * bit 49: Request for high ddr bus bandwidth * * */ -#define CFG_LATENCY_HOST_FLAGS_NORMAL \ - CFG_INI_UINT("wlm_latency_host_flags_normal",\ - 0, \ - 0xffffffff, \ - 0, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM Host flags for normal level") - -/* - * - * wlm_latency_host_flags_moderate - WLM Host flags setting for moderate level - * - * @min: 0x0 - * @max: 0xffffffff - * @default: 0x0 - * - * This ini decides which host latency features gets enabled - * in moderate latency mode. - * - * Usage: External - * - * |31 18| 17 | 16 |15 8|7 2| 1 | 0 | - * +------+------+--------+-----------+------+----------+-----------+ - * | RSVD | HBB | PM-QOS | RSVD | RSVD | REO Ring | RX Thread | - * +------+------+--------+-----------+------+----------+-----------+ - * | common | TX Path | RX Path | - * - * bit 0-7: Rx path related optimization - * bit 0: disable rx_thread for vdev - * bit 1: Reduce REO ring timer threshold to 32us(applicable for all REO ring) - * bit 2-7: Reserved - * bit 8-15: Tx path related optimization - * bit 8-15: Reserved - * bit 16-31: common changes - * bit 16: Request for pm_qos vote - * bit 17: Request for high ddr bus bandwidth - * - * - */ -#define CFG_LATENCY_HOST_FLAGS_MOD \ - CFG_INI_UINT("wlm_latency_host_flags_moderate",\ - 0, \ - 0xffffffff, \ - 0, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM Host flags for moderate level") -/* - * - * wlm_latency_host_flags_low - WLM Host flags setting for low level - * - * @min: 0x0 - * @max: 0xffffffff - * @default: 0x0 - * - * This ini decides which host latency features gets enabled - * in low latency mode. - * - * Usage: External - * - * |31 18| 17 | 16 |15 8|7 2| 1 | 0 | - * +------+------+--------+-----------+------+----------+-----------+ - * | RSVD | HBB | PM-QOS | RSVD | RSVD | REO Ring | RX Thread | - * +------+------+--------+-----------+------+----------+-----------+ - * | common | TX Path | RX Path | - * - * bit 0-7: Rx path related optimization - * bit 0: disable rx_thread for vdev - * bit 1: Reduce REO ring timer threshold to 32us(applicable for all REO ring) - * bit 2-7: Reserved - * bit 8-15: Tx path related optimization - * bit 8-15: Reserved - * bit 16-31: common changes - * bit 16: Request for pm_qos vote - * bit 17: Request for high ddr bus bandwidth - * - * - */ -#define CFG_LATENCY_HOST_FLAGS_LOW CFG_INI_UINT("wlm_latency_host_flags_low",\ - 0, \ - 0xffffffff, \ - 0, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM Host flags for low level") - -/* - * - * wlm_latency_host_flags_ultralow - WLM Host flags setting for ultralow level - * - * @min: 0x0 - * @max: 0xffffffff - * @default: 0x0 - * - * This ini decides which host latency features gets enabled - * in ultra low latency mode. - * - * Usage: External - * - * |31 18| 17 | 16 |15 8|7 2| 1 | 0 | - * +------+------+--------+-----------+------+----------+-----------+ - * | RSVD | HBB | PM-QOS | RSVD | RSVD | REO Ring | RX Thread | - * +------+------+--------+-----------+------+----------+-----------+ - * | common | TX Path | RX Path | - * - * bit 0-7: Rx path related optimization - * bit 0: disable rx_thread for vdev - * bit 1: Reduce REO ring timer threshold to 32us(applicable for all REO ring) - * bit 2-7: Reserved - * bit 8-15: Tx path related optimization - * bit 8-15: Reserved - * bit 16-31: common changes - * bit 16: Request for pm_qos vote - * bit 17: Request for high ddr bus bandwidth - * - * - */ -#define CFG_LATENCY_HOST_FLAGS_ULTLOW \ - CFG_INI_UINT("wlm_latency_host_flags_ultralow",\ - 0, \ - 0xffffffff, \ - 0, \ - CFG_VALUE_OR_DEFAULT, \ - "WLM Host flags for ultralow level") +#define CFG_DEFAULT_ULTLOW_FLAGS "0xc83" +#define CFG_LATENCY_FLAGS_ULTLOW \ + CFG_INI_STRING("wlm_latency_flags_ultralow",\ + 0, \ + sizeof(CFG_MAX_LATENCY_FLAGS) - 1,\ + CFG_DEFAULT_ULTLOW_FLAGS, \ + "WLM flags for ultralow level") #define CFG_FE_WLM_ALL \ CFG(CFG_LATENCY_ENABLE) \ @@ -436,10 +351,6 @@ CFG(CFG_LATENCY_FLAGS_NORMAL) \ CFG(CFG_LATENCY_FLAGS_MOD) \ CFG(CFG_LATENCY_FLAGS_LOW) \ - CFG(CFG_LATENCY_FLAGS_ULTLOW) \ - CFG(CFG_LATENCY_HOST_FLAGS_NORMAL) \ - CFG(CFG_LATENCY_HOST_FLAGS_MOD) \ - CFG(CFG_LATENCY_HOST_FLAGS_LOW) \ - CFG(CFG_LATENCY_HOST_FLAGS_ULTLOW) + CFG(CFG_LATENCY_FLAGS_ULTLOW) #endif /* __CFG_MLME_FE_WLM_H */