History

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

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 ...

Linus Torvalds committed 1 year ago

Commit cd7fa3e2 parents ad52c55 0104dcd26 files · +1650 −733Browse files

Showing the changes to include/uapi (1 of 26 files). Show all

Unified · Split

include/uapi/linux/thermal.h+22−7
@@ -3,6 +3,8 @@ · 2 unmodified lines
33 #define _UAPI_LINUX_THERMAL_H
44
55 #define THERMAL_NAME_LENGTH 20
6+#define THERMAL_THRESHOLD_WAY_UP BIT(0)
7+#define THERMAL_THRESHOLD_WAY_DOWN BIT(1)
68
79 enum thermal_device_mode {
810 THERMAL_DEVICE_DISABLED = 0,
@@ -18,7 +20,7 @@ enum thermal_trip_type { · 9 unmodified lines
1820
1921 /* Adding event notification support elements */
2022 #define THERMAL_GENL_FAMILY_NAME "thermal"
21−#define THERMAL_GENL_VERSION 0x01
23+#define THERMAL_GENL_VERSION 0x02
2224 #define THERMAL_GENL_SAMPLING_GROUP_NAME "sampling"
2325 #define THERMAL_GENL_EVENT_GROUP_NAME "event"
2426
@@ -28,6 +30,7 @@ enum thermal_genl_attr { · 3 unmodified lines
2830 THERMAL_GENL_ATTR_TZ,
2931 THERMAL_GENL_ATTR_TZ_ID,
3032 THERMAL_GENL_ATTR_TZ_TEMP,
33+ THERMAL_GENL_ATTR_TZ_PREV_TEMP,
3134 THERMAL_GENL_ATTR_TZ_TRIP,
3235 THERMAL_GENL_ATTR_TZ_TRIP_ID,
3336 THERMAL_GENL_ATTR_TZ_TRIP_TYPE,
@@ -48,6 +51,9 @@ enum thermal_genl_attr { · 14 unmodified lines
4851 THERMAL_GENL_ATTR_CPU_CAPABILITY_ID,
4952 THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE,
5053 THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY,
54+ THERMAL_GENL_ATTR_THRESHOLD,
55+ THERMAL_GENL_ATTR_THRESHOLD_TEMP,
56+ THERMAL_GENL_ATTR_THRESHOLD_DIRECTION,
5157 __THERMAL_GENL_ATTR_MAX,
5258 };
5359 #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
@@ -75,6 +81,11 @@ enum thermal_genl_event { · 21 unmodified lines
7581 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */
7682 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */
7783 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 */
7889 __THERMAL_GENL_EVENT_MAX,
7990 };
8091 #define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)
@@ -82,12 +93,16 @@ enum thermal_genl_event { · 1 unmodified line
8293 /* Commands supported by the thermal_genl_family */
8394 enum thermal_genl_cmd {
8495 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 */
91106 __THERMAL_GENL_CMD_MAX,
92107 };
93108 #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)