Skip to content

Commit eb8500b

Browse files
spandruvadadlezcano
authored andcommitted
thermal/drivers/intel: Initialize RW trip to THERMAL_TEMP_INVALID
After commit 81ad427 ("Thermal: Ignore invalid trip points") all user_space governor notifications via RW trip point is broken in intel thermal drivers. This commits marks trip_points with value of 0 during call to thermal_zone_device_register() as invalid. RW trip points can be 0 as user space will set the correct trip temperature later. During driver init, x86_package_temp and all int340x drivers sets RW trip temperature as 0. This results in all these trips marked as invalid by the thermal core. To fix this initialize RW trips to THERMAL_TEMP_INVALID instead of 0. Cc: <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6efb943 commit eb8500b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
237237
if (ACPI_FAILURE(status))
238238
trip_cnt = 0;
239239
else {
240+
int i;
241+
240242
int34x_thermal_zone->aux_trips =
241243
kcalloc(trip_cnt,
242244
sizeof(*int34x_thermal_zone->aux_trips),
@@ -247,6 +249,8 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
247249
}
248250
trip_mask = BIT(trip_cnt) - 1;
249251
int34x_thermal_zone->aux_trip_nr = trip_cnt;
252+
for (i = 0; i < trip_cnt; ++i)
253+
int34x_thermal_zone->aux_trips[i] = THERMAL_TEMP_INVALID;
250254
}
251255

252256
trip_cnt = int340x_thermal_read_trips(int34x_thermal_zone);

drivers/thermal/intel/x86_pkg_temp_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int sys_get_trip_temp(struct thermal_zone_device *tzd,
166166
if (thres_reg_value)
167167
*temp = zonedev->tj_max - thres_reg_value * 1000;
168168
else
169-
*temp = 0;
169+
*temp = THERMAL_TEMP_INVALID;
170170
pr_debug("sys_get_trip_temp %d\n", *temp);
171171

172172
return 0;

0 commit comments

Comments
 (0)