aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-23 18:22:46 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-23 18:22:46 +0100
commit2c8459a56870cbcda8bdc4cad12492b044277bdb (patch)
treef0d112002c58bcf5a846dad50fe355430bb84db6 /drivers/thermal
parent7251b9e8a007ddd834aa81f8c7ea338884629fec (diff)
parent0fac6893ff6c08d6fab6f56b9550a2c4cee589fd (diff)
downloadlinux-2c8459a56870cbcda8bdc4cad12492b044277bdb.tar.gz
Merge branch 'thermal-core'
Merge thermal core changes for 6.9: - Minor fixes for thermal governors (Rafael J. Wysocki, Di Shen). - Trip point handling fixes for the iwlwifi wireless driver (Rafael J. Wysocki). - Code cleanups (Rafael J. Wysocki, AngeloGioacchino Del Regno). * thermal-tmp: thermal: gov_power_allocator: Avoid overwriting PID coefficients from setup time thermal: sysfs: Fix up white space in trip_point_temp_store() iwlwifi: mvm: Use for_each_thermal_trip() for walking trip points iwlwifi: mvm: Populate trip table before registering thermal zone iwlwifi: mvm: Drop unused fw_trips_index[] from iwl_mvm_thermal_device thermal: core: Change governor name to const char pointer thermal: gov_bang_bang: Fix possible cooling device state ping-pong thermal: gov_fair_share: Fix dependency on trip points ordering
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/gov_bang_bang.c2
-rw-r--r--drivers/thermal/gov_fair_share.c16
-rw-r--r--drivers/thermal/gov_power_allocator.c2
-rw-r--r--drivers/thermal/thermal_sysfs.c2
4 files changed, 13 insertions, 9 deletions
diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c
index 6ddf0accdc98f..c3b2943a2db8b 100644
--- a/drivers/thermal/gov_bang_bang.c
+++ b/drivers/thermal/gov_bang_bang.c
@@ -49,7 +49,7 @@ static int thermal_zone_trip_update(struct thermal_zone_device *tz,
if (instance->target == 0 && tz->temperature >= trip->temperature)
instance->target = 1;
else if (instance->target == 1 &&
- tz->temperature <= trip->temperature - trip->hysteresis)
+ tz->temperature < trip->temperature - trip->hysteresis)
instance->target = 0;
dev_dbg(&instance->cdev->device, "target=%d\n",
diff --git a/drivers/thermal/gov_fair_share.c b/drivers/thermal/gov_fair_share.c
index 538abb7de4e2b..4da25a0009d73 100644
--- a/drivers/thermal/gov_fair_share.c
+++ b/drivers/thermal/gov_fair_share.c
@@ -18,22 +18,24 @@
static int get_trip_level(struct thermal_zone_device *tz)
{
const struct thermal_trip *trip, *level_trip = NULL;
- int trip_level;
+ int trip_level = -1;
for_each_trip(tz, trip) {
if (trip->temperature >= tz->temperature)
- break;
+ continue;
+
+ trip_level++;
- level_trip = trip;
+ if (!level_trip || trip->temperature > level_trip->temperature)
+ level_trip = trip;
}
/* Bail out if the temperature is not greater than any trips. */
- if (!level_trip)
+ if (trip_level < 0)
return 0;
- trip_level = thermal_zone_trip_id(tz, level_trip);
-
- trace_thermal_zone_trip(tz, trip_level, level_trip->type);
+ trace_thermal_zone_trip(tz, thermal_zone_trip_id(tz, level_trip),
+ level_trip->type);
return trip_level;
}
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index 81e061f183ad1..1b17dc4c219cc 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -711,6 +711,8 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
if (!tz->tzp->sustainable_power)
dev_warn(&tz->device, "power_allocator: sustainable_power will be estimated\n");
+ else
+ params->sustainable_power = tz->tzp->sustainable_power;
estimate_pid_constants(tz, tz->tzp->sustainable_power,
params->trip_switch_on,
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index f4033865b093a..d55f9303afb5b 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -136,7 +136,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
unlock:
mutex_unlock(&tz->lock);
-
+
return ret ? ret : count;
}