Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'thermal-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull thermal control fixes from Rafael Wysocki:
"These fix a thermal core breakage introduced by one of the recent
changes, amend those changes by adding 'const' to a new callback
argument and fix two memory leaks.

Specifics:

- Unbreak disabled trip point check in handle_thermal_trip() that may
cause it to skip enabled trip points (Rafael Wysocki)

- Add missing of_node_put() to of_find_trip_id() and
thermal_of_for_each_cooling_maps() that each break out of a
for_each_child_of_node() loop without dropping the reference to the
child object (Julia Lawall)

- Constify the recently added trip argument of the .get_trend()
thermal zone callback (Rafael Wysocki)"

* tag 'thermal-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
thermal: core: Fix disabled trip point check in handle_thermal_trip()
thermal: Constify the trip argument of the .get_trend() zone callback
thermal/of: add missing of_node_put()

+15 -8
+1 -1
drivers/acpi/thermal.c
··· 492 492 } 493 493 494 494 static int thermal_get_trend(struct thermal_zone_device *thermal, 495 - struct thermal_trip *trip, 495 + const struct thermal_trip *trip, 496 496 enum thermal_trend *trend) 497 497 { 498 498 struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
+4 -2
drivers/thermal/thermal_core.c
··· 348 348 struct thermal_trip trip; 349 349 350 350 /* Ignore disabled trip points */ 351 - if (test_bit(trip_id, &tz->trips_disabled) || 352 - trip.temperature == THERMAL_TEMP_INVALID) 351 + if (test_bit(trip_id, &tz->trips_disabled)) 353 352 return; 354 353 355 354 __thermal_zone_get_trip(tz, trip_id, &trip); 355 + 356 + if (trip.temperature == THERMAL_TEMP_INVALID) 357 + return; 356 358 357 359 if (tz->last_temperature != THERMAL_TEMP_INVALID) { 358 360 if (tz->last_temperature < trip.temperature &&
+6 -2
drivers/thermal/thermal_of.c
··· 37 37 */ 38 38 for_each_child_of_node(trips, t) { 39 39 40 - if (t == trip) 40 + if (t == trip) { 41 + of_node_put(t); 41 42 goto out; 43 + } 42 44 i++; 43 45 } 44 46 ··· 403 401 404 402 for_each_child_of_node(cm_np, child) { 405 403 ret = thermal_of_for_each_cooling_device(tz_np, child, tz, cdev, action); 406 - if (ret) 404 + if (ret) { 405 + of_node_put(child); 407 406 break; 407 + } 408 408 } 409 409 410 410 of_node_put(cm_np);
+2 -1
drivers/thermal/ti-soc-thermal/ti-thermal-common.c
··· 110 110 } 111 111 112 112 static int __ti_thermal_get_trend(struct thermal_zone_device *tz, 113 - struct thermal_trip *trip, enum thermal_trend *trend) 113 + const struct thermal_trip *trip, 114 + enum thermal_trend *trend) 114 115 { 115 116 struct ti_thermal_data *data = thermal_zone_device_priv(tz); 116 117 struct ti_bandgap *bgp;
+2 -2
include/linux/thermal.h
··· 80 80 int (*set_trip_hyst) (struct thermal_zone_device *, int, int); 81 81 int (*get_crit_temp) (struct thermal_zone_device *, int *); 82 82 int (*set_emul_temp) (struct thermal_zone_device *, int); 83 - int (*get_trend) (struct thermal_zone_device *, struct thermal_trip *, 84 - enum thermal_trend *); 83 + int (*get_trend) (struct thermal_zone_device *, 84 + const struct thermal_trip *, enum thermal_trend *); 85 85 void (*hot)(struct thermal_zone_device *); 86 86 void (*critical)(struct thermal_zone_device *); 87 87 };