瀏覽代碼

qcacld-3.0: Add support to optimize latency using pm_qos

For Voice and Music (V&M) products, extreme latency optimization is
needed while playing music and discovery, higher power consumption
in this mode could be accepted. With CONFIG_WLAN_LL_MODE enabled,
when latency_level is set to ultra low via cfg80211 vendor command,
update request pm qos type PM_QOS_CPU_DMA_LATENCY to level
DISABLE_KRAIT_IDLE_PS_VAL to speed up CPU efficiency and irq response.

Change-Id: Ifb5bc8169f1cd08500c4b4bc0dd65dd0b3667ab6
CRs-Fixed: 2685074
Surabhi Vishnoi 4 年之前
父節點
當前提交
ff7585ee9d

+ 3 - 0
Kbuild

@@ -3092,6 +3092,9 @@ cppflags-y += -DENABLE_HAL_SOC_STATS
 cppflags-y += -DENABLE_HAL_REG_WR_HISTORY
 endif
 
+# Enable Low latency optimisation mode
+cppflags-$(CONFIG_WLAN_FEATURE_LL_MODE) += -DWLAN_FEATURE_LL_MODE
+
 cppflags-$(CONFIG_WLAN_CLD_PM_QOS) += -DCLD_PM_QOS
 cppflags-$(CONFIG_REO_DESC_DEFER_FREE) += -DREO_DESC_DEFER_FREE
 cppflags-$(CONFIG_WLAN_FEATURE_11AX) += -DWLAN_FEATURE_11AX

+ 5 - 0
configs/qcs40x.snoc.perf_defconfig

@@ -173,6 +173,11 @@ CONFIG_REG_CLIENT := y
 CONFIG_WLAN_FEATURE_DP_BUS_BANDWIDTH := y
 CONFIG_WMI_CONCURRENCY_SUPPORT := y
 CONFIG_LL_DP_SUPPORT := y
+CONFIG_WLAN_FEATURE_LL_MODE := y
+
+ifeq ($(CONFIG_WLAN_FEATURE_LL_MODE), y)
+	CONFIG_WLAN_CLD_PM_QOS := y
+endif
 
 ifeq ($(CONFIG_QCA_WIFI_FTM), y)
 

+ 1 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1839,6 +1839,7 @@ struct hdd_context {
 	int radio_index;
 	qdf_work_t sap_pre_cac_work;
 	bool hbw_requested;
+	bool llm_enabled;
 	enum RX_OFFLOAD ol_enable;
 #ifdef WLAN_FEATURE_NAN
 	bool nan_datapath_enabled;

+ 1 - 0
core/hdd/inc/wlan_hdd_power.h

@@ -31,6 +31,7 @@
 
 #define HDD_WAKELOCK_TIMEOUT_CONNECT 1000
 #define HDD_WAKELOCK_TIMEOUT_RESUME 1000
+#define DISABLE_KRAIT_IDLE_PS_VAL      1
 
 /*
  * HDD_WAKELOCK_CONNECT_COMPLETE = CSR_JOIN_FAILURE_TIMEOUT_DEFAULT (3000) +

+ 25 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -6404,7 +6404,7 @@ void hdd_send_roam_scan_ch_list_event(struct hdd_context *hdd_ctx,
 }
 
 /**
- * wlan_hdd_send_roam_auth_event() - Send the roamed and authorized event
+ * lan_hdd_send_roam_auth_event() - Send the roamed and authorized event
  * @adapter: Pointer to adapter struct
  * @bssid: pointer to bssid of roamed AP.
  * @req_rsn_ie: Pointer to request RSN IE
@@ -7777,6 +7777,28 @@ static int hdd_config_total_beacon_miss_count(struct hdd_adapter *adapter,
 	return qdf_status_to_os_return(status);
 }
 
+#if defined(CLD_PM_QOS) && defined(WLAN_FEATURE_LL_MODE)
+void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level)
+{
+	if (latency_level ==
+	    QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW) {
+		hdd_ctx->llm_enabled = true;
+		if (!hdd_ctx->hbw_requested) {
+			pm_qos_update_request(&hdd_ctx->pm_qos_req,
+					      DISABLE_KRAIT_IDLE_PS_VAL);
+			hdd_ctx->hbw_requested = true;
+		}
+	} else {
+		if (hdd_ctx->hbw_requested) {
+			pm_qos_update_request(&hdd_ctx->pm_qos_req,
+					      PM_QOS_DEFAULT_VALUE);
+			hdd_ctx->hbw_requested = false;
+		}
+		hdd_ctx->llm_enabled = false;
+	}
+}
+#endif
+
 static int hdd_config_latency_level(struct hdd_adapter *adapter,
 				    const struct nlattr *attr)
 {
@@ -7797,6 +7819,8 @@ static int hdd_config_latency_level(struct hdd_adapter *adapter,
 		return -EINVAL;
 	}
 
+	wlan_hdd_set_wlm_mode(hdd_ctx, latency_level);
+
 	/* Map the latency value to the level which fw expected
 	 * 0 - normal, 1 - moderate, 2 - low, 3 - ultralow
 	 */

+ 17 - 0
core/hdd/src/wlan_hdd_cfg80211.h

@@ -799,4 +799,21 @@ QDF_STATUS wlan_hdd_send_sta_authorized_event(
 					struct hdd_adapter *adapter,
 					struct hdd_context *hdd_ctx,
 					const struct qdf_mac_addr *mac_addr);
+
+/**
+ * wlan_hdd_set_wlm_mode() - Function to set pm_qos config in wlm mode
+ * @hdd_ctx: HDD context
+ * @latency level: latency value received
+ *
+ * Return: None
+ */
+#if defined(CLD_PM_QOS) && defined(WLAN_FEATURE_LL_MODE)
+void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level);
+#else
+static inline
+void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level)
+{
+}
+#endif
+
 #endif

+ 0 - 2
core/hdd/src/wlan_hdd_driver_ops.c

@@ -53,8 +53,6 @@
 #define WLAN_MODULE_NAME  "wlan"
 #endif
 
-#define DISABLE_KRAIT_IDLE_PS_VAL      1
-
 #define SSR_MAX_FAIL_CNT 3
 static uint8_t re_init_fail_cnt, probe_fail_cnt;
 

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -8869,7 +8869,7 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx,
 
 		if ((next_vote_level == PLD_BUS_WIDTH_LOW) ||
 		    (next_vote_level == PLD_BUS_WIDTH_IDLE)) {
-			if (hdd_ctx->hbw_requested) {
+			if (hdd_ctx->hbw_requested && !hdd_ctx->llm_enabled) {
 				PLD_REMOVE_PM_QOS(hdd_ctx->parent_dev);
 				hdd_ctx->hbw_requested = false;
 			}