Pull thermal control updates from Rafael Wysocki: "These are thermal core changes, including the addition of support for temperature thresholds that can be set from user space, fixes related to thermal zone initialization, suspend/resume and exit, locking rework and rearrangement of the code handling thermal zone temperature updates. Specifics: - Add support for thermal thresholds that can be added and removed from user space via netlink along with a related library update (Daniel Lezcano) - Fix thermal zone initialization, suspend/resume and exit synchronization issues (Rafael Wysocki) - Rearrange locking in the thermal core to use guards (Rafael Wysocki) - Make the code handling thermal zone temperature updates use sorted lists of trip points to reduce the number of trip points table walks in the thermal core (Rafael Wysocki) - Fix and clean up the thermal testing facility code (Rafael Wysocki) - Fix a Power Allocator thermal governor issue (ZhengShaobo)" * tag 'thermal-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (45 commits) thermal: testing: Initialize some variables annoteded with _free() thermal: testing: Use DEFINE_FREE() and __free() to simplify code thermal: testing: Simplify tt_get_tt_zone() thermal: gov_power_allocator: Granted power set to max when nobody request power thermal: core: Relocate thermal zone initialization routine thermal: core: Use trip lists for trip crossing detection thermal: core: Eliminate thermal_zone_trip_down() thermal: core: Relocate functions that update trip points thermal: core: Move some trip processing to thermal_trip_crossed() thermal: core: Pass trip descriptor to thermal_trip_crossed() thermal: core: Rearrange __thermal_zone_device_update() thermal: core: Prepare for moving trips between sorted lists thermal: core: Rename trip list node in struct thermal_trip_desc thermal: core: Build sorted lists instead of sorting them later thermal/lib: Fix memory leak on error in thermal_genl_auto() thermal: thresholds: Fix thermal lock annotation issue tools/thermal/thermal-engine: Take into account the thresholds API tools/lib/thermal: Add the threshold netlink ABI tools/lib/thermal: Make more generic the command encoding function thermal: netlink: Add the commands and the events for the thresholds ...
Showing the changes to include/uapi (1 of 26 files). Show all
Unified · Split
| @@ -3,6 +3,8 @@ · 2 unmodified lines | ||
| 3 | 3 | #define _UAPI_LINUX_THERMAL_H |
| 4 | 4 | |
| 5 | 5 | #define THERMAL_NAME_LENGTH 20 |
| 6 | +#define THERMAL_THRESHOLD_WAY_UP BIT(0) | |
| 7 | +#define THERMAL_THRESHOLD_WAY_DOWN BIT(1) | |
| 6 | 8 | |
| 7 | 9 | enum thermal_device_mode { |
| 8 | 10 | THERMAL_DEVICE_DISABLED = 0, |
| @@ -18,7 +20,7 @@ enum thermal_trip_type { · 9 unmodified lines | ||
| 18 | 20 | |
| 19 | 21 | /* Adding event notification support elements */ |
| 20 | 22 | #define THERMAL_GENL_FAMILY_NAME "thermal" |
| 21 | −#define THERMAL_GENL_VERSION 0x01 | |
| 23 | +#define THERMAL_GENL_VERSION 0x02 | |
| 22 | 24 | #define THERMAL_GENL_SAMPLING_GROUP_NAME "sampling" |
| 23 | 25 | #define THERMAL_GENL_EVENT_GROUP_NAME "event" |
| 24 | 26 | |
| @@ -28,6 +30,7 @@ enum thermal_genl_attr { · 3 unmodified lines | ||
| 28 | 30 | THERMAL_GENL_ATTR_TZ, |
| 29 | 31 | THERMAL_GENL_ATTR_TZ_ID, |
| 30 | 32 | THERMAL_GENL_ATTR_TZ_TEMP, |
| 33 | + THERMAL_GENL_ATTR_TZ_PREV_TEMP, | |
| 31 | 34 | THERMAL_GENL_ATTR_TZ_TRIP, |
| 32 | 35 | THERMAL_GENL_ATTR_TZ_TRIP_ID, |
| 33 | 36 | THERMAL_GENL_ATTR_TZ_TRIP_TYPE, |
| @@ -48,6 +51,9 @@ enum thermal_genl_attr { · 14 unmodified lines | ||
| 48 | 51 | THERMAL_GENL_ATTR_CPU_CAPABILITY_ID, |
| 49 | 52 | THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE, |
| 50 | 53 | THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY, |
| 54 | + THERMAL_GENL_ATTR_THRESHOLD, | |
| 55 | + THERMAL_GENL_ATTR_THRESHOLD_TEMP, | |
| 56 | + THERMAL_GENL_ATTR_THRESHOLD_DIRECTION, | |
| 51 | 57 | __THERMAL_GENL_ATTR_MAX, |
| 52 | 58 | }; |
| 53 | 59 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) |
| @@ -75,6 +81,11 @@ enum thermal_genl_event { · 21 unmodified lines | ||
| 75 | 81 | THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */ |
| 76 | 82 | THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */ |
| 77 | 83 | THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE, /* CPU capability changed */ |
| 84 | + THERMAL_GENL_EVENT_THRESHOLD_ADD, /* A thresold has been added */ | |
| 85 | + THERMAL_GENL_EVENT_THRESHOLD_DELETE, /* A thresold has been deleted */ | |
| 86 | + THERMAL_GENL_EVENT_THRESHOLD_FLUSH, /* All thresolds have been deleted */ | |
| 87 | + THERMAL_GENL_EVENT_THRESHOLD_UP, /* A thresold has been crossed the way up */ | |
| 88 | + THERMAL_GENL_EVENT_THRESHOLD_DOWN, /* A thresold has been crossed the way down */ | |
| 78 | 89 | __THERMAL_GENL_EVENT_MAX, |
| 79 | 90 | }; |
| 80 | 91 | #define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1) |
| @@ -82,12 +93,16 @@ enum thermal_genl_event { · 1 unmodified line | ||
| 82 | 93 | /* Commands supported by the thermal_genl_family */ |
| 83 | 94 | enum thermal_genl_cmd { |
| 84 | 95 | THERMAL_GENL_CMD_UNSPEC, |
| 85 | − THERMAL_GENL_CMD_TZ_GET_ID, /* List of thermal zones id */ | |
| 86 | − THERMAL_GENL_CMD_TZ_GET_TRIP, /* List of thermal trips */ | |
| 87 | − THERMAL_GENL_CMD_TZ_GET_TEMP, /* Get the thermal zone temperature */ | |
| 88 | − THERMAL_GENL_CMD_TZ_GET_GOV, /* Get the thermal zone governor */ | |
| 89 | − THERMAL_GENL_CMD_TZ_GET_MODE, /* Get the thermal zone mode */ | |
| 90 | − THERMAL_GENL_CMD_CDEV_GET, /* List of cdev id */ | |
| 96 | + THERMAL_GENL_CMD_TZ_GET_ID, /* List of thermal zones id */ | |
| 97 | + THERMAL_GENL_CMD_TZ_GET_TRIP, /* List of thermal trips */ | |
| 98 | + THERMAL_GENL_CMD_TZ_GET_TEMP, /* Get the thermal zone temperature */ | |
| 99 | + THERMAL_GENL_CMD_TZ_GET_GOV, /* Get the thermal zone governor */ | |
| 100 | + THERMAL_GENL_CMD_TZ_GET_MODE, /* Get the thermal zone mode */ | |
| 101 | + THERMAL_GENL_CMD_CDEV_GET, /* List of cdev id */ | |
| 102 | + THERMAL_GENL_CMD_THRESHOLD_GET, /* List of thresholds */ | |
| 103 | + THERMAL_GENL_CMD_THRESHOLD_ADD, /* Add a threshold */ | |
| 104 | + THERMAL_GENL_CMD_THRESHOLD_DELETE, /* Delete a threshold */ | |
| 105 | + THERMAL_GENL_CMD_THRESHOLD_FLUSH, /* Flush all the thresholds */ | |
| 91 | 106 | __THERMAL_GENL_CMD_MAX, |
| 92 | 107 | }; |
| 93 | 108 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) |