Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/thermal

FieldValue
Subsystemthermal core, drivers/thermal/thermal_sysfs.c (zone, cooling-device, stats attrs); class registered in drivers/thermal/thermal_core.c
Config gateCONFIG_THERMAL (obj-$(CONFIG_THERMAL) += thermal_sys.o in drivers/thermal/Makefile, torvalds/linux master)
ABI documentationDocumentation/ABI/testing/sysfs-class-thermal
Sincenot stated: the ABI file carries no Date: or KernelVersion: lines
Live (5.10.134 host)class directory present, 0 thermal zones and 0 cooling devices (container)
Ledger IDSYSC-thermal

What it represents

One thermal_zoneX directory per temperature sensor managed by the thermal framework, and one cooling_deviceX per controllable consumer of thermal state (fans, cpufreq cooling, devfreq cooling). A governor per zone reads the temperature, compares it with trip points, and throttles bound cooling devices. There is no separate thermal_cooling class in mainline: v5.10 and master thermal_core.c register a single class named thermal, so cooling devices live in this directory too.

Relationship to the device model

thermal_zoneX and cooling_deviceX are class views over /sys/devices/... nodes created by zone drivers (ACPI, OF thermal, x86_pkg_temp, int340x, and so on). Each zone carries cdevY symlinks pointing at the cooling devices bound to it. No bus of its own and no /sys/dev char/block entry.

Attributes

27 attribute paths are documented in Documentation/ABI/testing/sysfs-class-thermal. The table below is representative.

AttributeR/WUnit/formatConditional?Source
thermal_zoneX/typeROshort lowercase string (for example acpitz)no (required)ABI What thermal_zoneX/type
thermal_zoneX/tempROmillidegree Celsiusno (required)ABI What thermal_zoneX/temp
thermal_zoneX/modeRWenabled/disabledoptionalABI What thermal_zoneX/mode
thermal_zoneX/policyRWgovernor namerequiredABI What thermal_zoneX/policy
thermal_zoneX/available_policiesROgovernor listrequiredABI What available_policies
thermal_zoneX/trip_point_Y_tempROmillidegree Celsiusper trip pointABI What trip_point_Y_temp
thermal_zoneX/trip_point_Y_typeROcritical, hot, passive, active[0-*]per trip pointABI What trip_point_Y_type
thermal_zoneX/trip_point_Y_hystRWdegrees Celsius (integer)per trip pointABI What trip_point_Y_hyst
thermal_zoneX/cdevYROsymlink to cooling deviceper bound cdevABI What thermal_zoneX/cdevY
thermal_zoneX/cdevY_weightRWrelative influence valueper bound cdevABI What cdevY_weight
thermal_zoneX/emul_tempWOmillidegree Celsius; 0 disables emulationdebugging hookABI What emul_temp
thermal_zoneX/sustainable_powerRWmilliwatts (power allocator governor)power allocator zonesABI What sustainable_power
cooling_deviceX/typeROstring (for example Processor, Fan)no (required)ABI What cooling_deviceX/type
cooling_deviceX/cur_stateRWinteger 0..max_stateno (required)ABI What cur_state
cooling_deviceX/max_stateROintegerno (required)ABI What max_state
cooling_deviceX/stats/*RO/WOtime_in_state_ms, trans_table, total_trans, resetstats supportABI What stats/* entries

The k_pu, k_i, k_d, integral_cutoff, slope, and offset attributes belong to power-allocator and hotspot-model zones and are optional.

Safety and writes

temp, type, and trip points are safe to read. cur_state writes manually throttle hardware (set 0 for no cooling); on a CPU cooling device this is effectively a cpufreq clamp. emul_temp carries an explicit ABI warning: flooding it with low values disables kernel thermal policy, which can overheat a production system. stats/reset wipes cooling statistics. All writes need root.

References

  • Documentation/ABI/testing/sysfs-class-thermal (cached copy: 259 lines)
  • drivers/thermal/thermal_sysfs.c, drivers/thermal/thermal_core.c, drivers/thermal/Makefile (v5.10 cross-check per worklog 2-b; master)
  • Documentation/driver-api/thermal/power_allocator.rst
  • Ledger row SYSC-thermal; worklog Task 2-b (no mainline thermal_cooling class)