Browse Source

qcacld-3.0: Enable Multi-Client feature for Thermal throttle service

Currently, for Thermal Throttle service, Multi-Client feature is enabled
for QCA6750 only but now it is enabled for all the targets.

Change-Id: I0afd48c481193d02c473bc7daa2226c9225968ed
CRs-Fixed: 3174679
Rahul Gusain 3 years ago
parent
commit
89a0498939

+ 1 - 1
configs/default_defconfig

@@ -1480,11 +1480,11 @@ endif
 #Enable Hang Event
 CONFIG_WLAN_HANG_EVENT := y
 
-ifeq ($(CONFIG_CNSS_QCA6750), y)
 ifeq ($(CONFIG_FW_THERMAL_THROTTLE), y)
 CONFIG_WLAN_THERMAL_MULTI_CLIENT_SUPPORT := y
 endif
 
+ifeq ($(CONFIG_CNSS_QCA6750), y)
 ifeq ($(CONFIG_LITHIUM), y)
 CONFIG_DP_LEGACY_MODE_CSM_DEFAULT_DISABLE := 1
 CONFIG_DP_RX_DESC_COOKIE_INVALIDATE := y

+ 2 - 1
core/hdd/src/wlan_hdd_sysfs_thermal_cfg.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020 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 above
@@ -146,7 +147,7 @@ __hdd_sysfs_thermal_cfg_store(struct hdd_context *hdd_ctx,
 	therm_cfg_params.levelconf[0].dcoffpercent = val3;
 	therm_cfg_params.levelconf[0].priority = val4;
 	therm_cfg_params.levelconf[0].tmplwm = val7;
-	hdd_thermal_fill_clientid_priority(THERMAL_MONITOR_APPS,
+	hdd_thermal_fill_clientid_priority(hdd_ctx, THERMAL_MONITOR_APPS,
 					   thermal_temp.priority_apps,
 					   thermal_temp.priority_wpps,
 					   &therm_cfg_params);

+ 20 - 15
core/hdd/src/wlan_hdd_thermal.c

@@ -58,22 +58,26 @@ const struct nla_policy
 
 #ifdef FEATURE_WPSS_THERMAL_MITIGATION
 void
-hdd_thermal_fill_clientid_priority(uint8_t mon_id, uint8_t priority_apps,
-				   uint8_t priority_wpps,
+hdd_thermal_fill_clientid_priority(struct hdd_context *hdd_ctx, uint8_t mon_id,
+				   uint8_t priority_apps, uint8_t priority_wpps,
 				   struct thermal_mitigation_params *params)
 {
-	if (mon_id == THERMAL_MONITOR_APPS) {
-		params->priority  = priority_apps;
-		params->client_id = mon_id;
-		hdd_debug("Thermal client:%d priority_apps: %d", mon_id,
-			  priority_apps);
-	} else if (mon_id == THERMAL_MONITOR_WPSS) {
-		params->priority = priority_wpps;
-		params->client_id = mon_id;
-		/* currently hardcoded, can be changed based on requirement */
-		params->levelconf[0].dcoffpercent = DC_OFF_PERCENT_WPPS;
-		hdd_debug("Thermal client:%d priority_wpps: %d", mon_id,
-			  priority_wpps);
+	if (hdd_ctx->multi_client_thermal_mitigation) {
+		if (mon_id == THERMAL_MONITOR_APPS) {
+			params->priority  = priority_apps;
+			params->client_id = mon_id;
+			hdd_debug("Thermal client:%d priority_apps: %d", mon_id,
+				  priority_apps);
+		} else if (mon_id == THERMAL_MONITOR_WPSS) {
+			params->priority = priority_wpps;
+			params->client_id = mon_id;
+			/* currently hardcoded,
+			 * can be changed based on requirement.
+			 */
+			params->levelconf[0].dcoffpercent = DC_OFF_PERCENT_WPPS;
+			hdd_debug("Thermal client:%d priority_wpps: %d", mon_id,
+				  priority_wpps);
+		}
 	}
 }
 #endif
@@ -129,7 +133,8 @@ hdd_send_thermal_mitigation_val(struct hdd_context *hdd_ctx, uint32_t level,
 	therm_cfg_params.num_thermal_conf = 1;
 	therm_cfg_params.pdev_id = 0;
 
-	hdd_thermal_fill_clientid_priority(mon_id, thermal_temp.priority_apps,
+	hdd_thermal_fill_clientid_priority(hdd_ctx, mon_id,
+					   thermal_temp.priority_apps,
 					   thermal_temp.priority_wpps,
 					   &therm_cfg_params);
 

+ 9 - 7
core/hdd/src/wlan_hdd_thermal.h

@@ -163,22 +163,24 @@ hdd_send_thermal_mitigation_val(struct hdd_context *hdd_ctx, uint32_t level,
 #ifdef FEATURE_WPSS_THERMAL_MITIGATION
 /**
  * hdd_thermal_fill_clientid_priority() - fill the client id/priority
- *
+ * @hdd_ctx: pointer to hdd contex structure
  * @mon_id: Thermal monitor id ie.. apps or wpss
- * @priority: Priority of the client to be considered
+ * @priority_apps: Priority of the apps client to be considered
+ * @priority_wpps: Priority of the wpps client to be considered
+ * @params: pointer to thermal mitigation parameters
  *
- * Fill the clientid/priority for the firmware to consider.
+ * Fill the clientid/priority for the firmwaire to consider.
  *
  * Return: none
  */
 void
-hdd_thermal_fill_clientid_priority(uint8_t mon_id, uint8_t priority_apps,
-				   uint8_t priority_wpps,
+hdd_thermal_fill_clientid_priority(struct hdd_context *hdd_ctx, uint8_t mon_id,
+				   uint8_t priority_apps, uint8_t priority_wpps,
 				   struct thermal_mitigation_params *params);
 #else
 static inline void
-hdd_thermal_fill_clientid_priority(uint8_t mon_id, uint8_t priority_apps,
-				   uint8_t priority_wpps,
+hdd_thermal_fill_clientid_priority(struct hdd_context *hdd_ctx, uint8_t mon_id,
+				   uint8_t priority_apps, uint8_t priority_wpps,
 				   struct thermal_mitigation_params *params)
 {
 }

+ 2 - 1
core/hdd/src/wlan_hdd_wext.c

@@ -7430,7 +7430,8 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 		therm_cfg_params.levelconf[0].dcoffpercent = apps_args[2];
 		therm_cfg_params.levelconf[0].priority = apps_args[3];
 		therm_cfg_params.levelconf[0].tmplwm = apps_args[6];
-		hdd_thermal_fill_clientid_priority(THERMAL_MONITOR_APPS,
+		hdd_thermal_fill_clientid_priority(hdd_ctx,
+						   THERMAL_MONITOR_APPS,
 						   thermal_temp.priority_apps,
 						   thermal_temp.priority_wpps,
 						   &therm_cfg_params);