From fc656fa14da7865774b4251afa88ffcf22bf02d2 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Sat, 2 Oct 2021 00:33:23 +0200 Subject: thermal/drivers/netlink: Add the temperature when crossing a trip point The slope of the temperature increase or decrease can be high and when the temperature crosses the trip point, there could be a significant difference between the trip temperature and the measured temperatures. That forces the userspace to read the temperature back right after receiving a trip violation notification. In order to be efficient, give the temperature which resulted in the trip violation. Signed-off-by: Daniel Lezcano Acked-by: Srinivas Pandruvada Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20211001223323.1836640-1-daniel.lezcano@linaro.org --- drivers/thermal/thermal_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/thermal/thermal_core.c') diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 51374f4e1cca..9e243d9f929e 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -375,10 +375,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) if (tz->last_temperature != THERMAL_TEMP_INVALID) { if (tz->last_temperature < trip_temp && tz->temperature >= trip_temp) - thermal_notify_tz_trip_up(tz->id, trip); + thermal_notify_tz_trip_up(tz->id, trip, + tz->temperature); if (tz->last_temperature >= trip_temp && tz->temperature < (trip_temp - hyst)) - thermal_notify_tz_trip_down(tz->id, trip); + thermal_notify_tz_trip_down(tz->id, trip, + tz->temperature); } if (type == THERMAL_TRIP_CRITICAL || type == THERMAL_TRIP_HOT) -- cgit