1thermal-conf.xml(5) File Formats Manual thermal-conf.xml(5)
2
3
4
6 thermal-conf.xml - Configuration file for thermal daemon
7
9 $(TDCONFDIR)/etc/thermald/thermal-conf.xml
10
11
13 thermal-conf.xml is a configuration file for the thermal daemon. It is
14 used to configure thermal sensors, zone and cooling devices.The loca‐
15 tion of this file depends on the configuration option used during build
16 time.
17
18 The terminology used in this file conforms to "Advanced Configuration
19 and Power Interface Specification". The ACPI thermal model is based
20 around conceptual platform regions called thermal zones that physically
21 contain devices, thermal sensors, and cooling controls. For example of
22 a thermal zone can be a CPU or a laptop cover. A zone can contain mul‐
23 tiple sensors for monitoring temperature. A cooling device provides
24 interface to reduce the temperature of a source device, which causes
25 increase in the temperature. An example of a cooling device is a FAN or
26 some Linux driver which can throttle the source device.
27
28 A thermal zone configuration includes one or more trip points. A trip
29 point is a temperature at which a cooling device needs to be activated.
30
31 A cooling device can be either active or passive. An example of an
32 active device is a FAN, which will not reduce performance at the cost
33 of consuming more power and noise. A passive device uses performance
34 throttling to control temperature. In addition to cooling devices
35 present in the thermal sysfs, the following cooling devices are built
36 into the thermald, which can be used as valid cooling device type:
37
38 - rapl_controller
39
40 - intel_pstate
41
42 - cpufreq
43
44 - LCD
45
46 The thermal sysfs under Linux (/sys/class/thermal) provides a way to
47 represent per platform ACPI configuration. The kernel thermal governor
48 uses this data to keep the platform thermals under control. But there
49 are some limitations, which thermald tries to resolve. For example:
50
51 - If the ACPI data is not optimized or buggy. In this case thermal-
52 conf.xml can be used to correct the behavior without change in BIOS.
53
54 - There may be thermal zones exposed by the thermal sysfs without asso‐
55 ciated cooling actions. In this case thermal conf.xml can be used to
56 tie the cooling devices to those zones.
57
58 - The best cooling method may not be in the thermal sysfs. In this case
59 thermal-conf.xml can be used to bind a zone to an external cooling
60 device.
61
62 - Specify thermal relationships. A zone can be influenced by multiple
63 source devices with varying degrees. In this case thermal-conf.xml can
64 be used to define the relative influence for apply compensation.
65
66
68 The configuration file format conforms to XML specifications. A set of
69 tags defined to define platform, sensors, zones, cooling devices and
70 trip points.
71
72 <ThermalConfiguration>
73
74 <Platform>
75
76 <Name>Example Platform Name</Name>
77
78 <!--UUID is optional, if present this will be matched. Both prod‐
79 uct name and UUID can contain wild card "*", which matches any plat‐
80 form.-->
81
82 <UUID>Example UUID</UUID>
83
84 configuration file format conforms to XML specifications. A set of
85 tags defined to define platform, sensors, zones, cooling
86 devices and trip points.
87
88 <ThermalConfiguration>
89
90 <Platform>
91
92
93 <ProductName>Example Product Name</ProductName>
94
95 <Preference>QUIET|PERFORMANCE</Preference>
96
97 <!-Quiet mode will only use passive cooling device. "PERFORMANCE"
98 will only select active devices .-->
99
100 <ThermalSensors>
101
102 <ThermalSensor>
103
104 <!-- New Sensor with a type and path -->
105
106 <Type>example_sensor_1</Type>
107
108 <Path>/some_path</Path>
109
110 <AsyncCapable>0</AsyncCapable>
111
112 </ThermalSensor>
113
114 <ThermalSensor>
115
116 <!-- Already present in thermal sysfs, enable this or
117 add/change config For example, here we are indicating that sensor can
118 do async events to avoid polling
119 -->
120
121 <Type>example_thermal_sysfs_sensor</Type>
122
123 <!-- If async capable, then we don't need to poll -->
124
125 <AsyncCapable>1</AsyncCapable>
126
127 </ThermalSensor>
128
129 </ThermalSensors>
130
131 <ThermalZones>
132
133 <ThermalZone>
134
135 <Type>Example Zone type</Type>
136
137 <TripPoints>
138
139 <TripPoint>
140
141 <SensorType>example_sensor_1</SensorType>
142
143 <!-- Temperature at which to take action -->
144
145 <Temperature> 75000 </Temperature>
146
147 <!-- max/passive/active If a MAX type is spec‐
148 ified, then daemon will use PID control to aggressively throttle to
149 avoid reaching this temp.-->
150
151 <type>max</type>
152
153 <!-- SEQUENTIAL | PARALLEL. When a trip point
154 temp is violated, then number of cooling devices can be activated. If
155 control type is SEQUENTIAL then, it will exhaust first cooling device
156 before trying next. -->
157
158 <ControlType>SEQUENTIAL</ControlType>
159
160 <CoolingDevice>
161
162 <index>1</index>
163
164 <type>example_cooling_device</type>
165
166 <!-- Influence will be used order cooling
167 devices. First cooling device will be used, which has highest influ‐
168 ence. -->
169
170 <influence> 100 </influence>
171
172 <!-- Delay in using this cdev, this takes
173 some time too actually cool a zone -->
174
175 <SamplingPeriod> 12 </SamplingPeriod>
176
177 <!-- Set a specific state of this cooling
178 device when this trip is violated -->
179
180 <TargetState> 6 </TargetState>
181
182 </CoolingDevice>
183
184 </TripPoint>
185
186 </TripPoints>
187
188 </ThermalZone>
189
190 </ThermalZones>
191
192 <CoolingDevices>
193
194 <CoolingDevice>
195
196 <!-- Cooling device can be specified by a type and
197 optionally a sysfs path. If the type is already present in thermal
198 sysfs, there is no need of a path. Compensation can use min/max and
199 step size to increasing cool the system. Debounce period can be used to
200 force a waiting period for action. -->
201
202 <Type>example_cooling_device</Type>
203
204 <MinState>0</MinState>
205
206 <IncDecStep>10</IncDecStep>
207
208 <ReadBack> 0 </ReadBack>
209
210 <MaxState>50</MaxState>
211
212 <DebouncePeriod>5000</DebouncePeriod>
213
214 <!-- If there are no PID parameters, compensation
215 increase step wise and exponentially (if single step is not able to
216 change trend). Alternatively a PID parameters can be specified then
217 next step will use PID calculation using provided PID constants. -->
218
219 <PidControl>
220
221 <kp>0.001</kp>
222
223 <kd>0.0001</kd>
224
225 <ki>0.0001</ki>
226
227 </PidControl>
228
229 <!-- Write some prefix attached to state value, like
230 below the prefix is "level ". It will preserve spaces as entered when
231 writing to sysfs -->
232 <WritePrefix>level </WritePrefix>
233 </CoolingDevice>
234
235 </CoolingDevices>
236
237 </Platform>
238
239 </ThermalConfiguration>
240
242 Example 1: This is a very simple configuration, to change the passive
243 limit on the CPU. Instead of default, this new temperature 86C in the
244 configuration is used. This will start cooling, once the temperature
245 reaches 86C.
246
247 <?xml version="1.0"?>
248
249 <ThermalConfiguration>
250
251 <Platform>
252
253 <Name>Overide CPU default passive</Name>
254
255 <ProductName>*</ProductName>
256
257 <Preference>QUIET</Preference>
258
259 <ThermalZones>
260
261 <ThermalZone>
262
263 <Type>cpu</Type>
264
265 <TripPoints>
266
267 <TripPoint>
268
269 <Tempera‐
270 ture>86000</Temperature>
271
272 <type>pas‐
273 sive</type>
274
275 </TripPoint>
276
277 </TripPoints>
278
279 </ThermalZone>
280
281 </ThermalZones>
282
283 </Platform>
284
285 </ThermalConfiguration>
286
287 Example 2: In this configuration, we are controlling backlight when
288 some sensor "SEN2" reaches 60C. Here "LCD" is a standard cooling
289 device, which uses Linux backlight sysfs interface. "LCD_Zone" is a
290 valid thermal zone in Linux thermal sysfs on the test platform, hence
291 we don't need to provide path for sysfs for "LCD_Zone". The Linux ther‐
292 mal sysfs is already parsed and loaded by thermald program.
293
294 <?xml version="1.0"?>
295
296 <ThermalConfiguration>
297
298 <Platform>
299
300 <Name>Change Backlight</Name>
301
302 <ProductName>*</ProductName>
303
304 <Preference>QUIET</Preference>
305
306 <ThermalZones>
307
308 <ThermalZone>
309
310 <Type>LCD_Zone</Type>
311
312 <TripPoints>
313
314 <TripPoint>
315
316 <SensorType>SEN2</SensorType>
317
318 <Temperature>60000</Temperature>
319
320 <type>passive</type>
321
322 <CoolingDevice>
323
324 <Type>LCD</Type>
325
326 </CoolingDevice>
327
328 </TripPoint>
329
330 </TripPoints>
331
332 </ThermalZone>
333
334 </ThermalZones>
335
336 </Platform>
337
338 </ThermalConfiguration>
339
340 Example 3: In this example Lenovo Thinkpad X220 and fan speed is con‐
341 trolled. Here a cooling device "_Fan", can be controlled via sysfs
342 /sys/devices/platform/thinkpad_hwmon/pwm1. When the x86_pkg_temp
343 reaches 45C, Fan is started with increasing speeds, if the tem‐
344 perature can't be controlled at 45C.
345
346 <?xml version="1.0"?>
347
348 <ThermalConfiguration>
349
350 <Platform>
351
352 <Name>Lenovo ThinkPad X220</Name>
353
354 <ProductName>*</ProductName>
355
356 <Preference>QUIET</Preference>
357
358 <ThermalZones>
359
360 <ThermalZone>
361
362 <Type>x86_pkg_temp</Type>
363
364 <TripPoints>
365
366 <TripPoint>
367
368 <Sen‐
369 sorType>x86_pkg_temp</SensorType>
370
371 <Tem‐
372 perature>45000</Temperature>
373
374 <type>pas‐
375 sive</type>
376
377 <Con‐
378 trolType>SEQUENTIAL</ControlType>
379
380 <Cool‐
381 ingDevice>
382
383 <index>1</index>
384
385 <type>_Fan</type>
386
387 <influ‐
388 ence> 100 </influence>
389
390 <Sam‐
391 plingPeriod> 12 </SamplingPeriod>
392
393 </Cool‐
394 ingDevice>
395
396 </TripPoint>
397
398 </TripPoints>
399
400 </ThermalZone>
401
402 </ThermalZones>
403
404 <CoolingDevices>
405
406 <CoolingDevice>
407
408 <Type>_Fan</Type>
409
410 <Path>/sys/devices/plat‐
411 form/thinkpad_hwmon/pwm1</Path>
412
413 <MinState>0</MinState>
414
415 <IncDecStep>30</IncDecStep>
416
417 <ReadBack> 0 </ReadBack>
418
419 <MaxState>255</MaxState>
420
421 <DebouncePeriod>5</DebouncePeriod>
422
423 </CoolingDevice>
424
425 </CoolingDevices>
426
427 </Platform>
428
429 </ThermalConfiguration>
430
431 Example 4: The following example shows how PID can be used. Here once
432 temperature exceeds 80C, compensation is calculated using PID using 80C
433 as set point of PID. The compensation depends on error from the set
434 point. Here the default built in processor cooling device is used with
435 min state as 0 and max state as 10.
436
437 <?xml version="1.0"?>
438
439 <ThermalConfiguration>
440
441 <Platform>
442
443 <Name>Use PID param </Name>
444
445 <ProductName>*</ProductName>
446
447 <Preference>QUIET</Preference>
448
449 <ThermalZones>
450
451 <ThermalZone>
452
453 <Type>x86_pkg_temp</Type>
454
455 <TripPoints>
456
457 <TripPoint>
458
459 <Sen‐
460 sorType>x86_pkg_temp</SensorType>
461
462 <Tem‐
463 perature>80000</Temperature>
464
465 <type>pas‐
466 sive</type>
467
468 <Con‐
469 trolType>SEQUENTIAL</ControlType>
470
471 <Cool‐
472 ingDevice>
473
474 <type>Processor</type>
475
476 </Cool‐
477 ingDevice>
478
479 </TripPoint>
480
481 </TripPoints>
482
483 </ThermalZone>
484
485 </ThermalZones>
486
487 <CoolingDevices>
488
489 <CoolingDevice>
490
491 <Type>Processor</Type>
492
493 <PidControl>
494
495 <kp>0.0002</kp>
496
497 <kd>0</kd>
498
499 <ki>0</ki>
500
501 </PidControl>
502
503 </CoolingDevice>
504
505 </CoolingDevices>
506
507 </Platform>
508
509 </ThermalConfiguration>
510
511
512 Example 5: The following example shows how to control Fan when
513 the sysfs expects some string prefix. For example instead of
514 just write a number to fan control sysfs, the interface requires
515 "level " in front of the speed index value.
516
517 <?xml version="1.0"?>
518
519 <ThermalConfiguration>
520
521 <Platform>
522
523 <Name>Use Fan control first then CPU throttle </Name>
524
525 <ProductName>*</ProductName>
526
527 <Preference>QUIET</Preference>
528
529 <ThermalZones>
530
531 <ThermalZone>
532
533 <Type>x86_pkg_temp</Type>
534
535 <TripPoints>
536
537 <Trip‐
538 Point>
539
540 <Sen‐
541 sorType>x86_pkg_temp</SensorType>
542
543 <Tem‐
544 perature>80000</Temperature>
545
546 <type>pas‐
547 sive</type>
548
549 <Con‐
550 trolType>SEQUENTIAL</ControlType>
551
552 <Cool‐
553 ingDevice>
554
555 <type>_fan_</type>
556
557 </Cool‐
558 ingDevice>
559
560 </Trip‐
561 Point>
562
563 </TripPoints>
564
565 </ThermalZone>
566
567 </ThermalZones>
568
569 <CoolingDevices>
570
571 <CoolingDevice>
572
573 <Type>_fan_</Type>
574
575 <Path>/proc/acpi/ibm/fan</Path>
576
577 <WritePrefix>level </WritePrefix>
578
579 <MinState>0</MinState>
580
581 <MaxState>5</MaxState>
582
583 <DebouncePeriod>10</DebouncePeriod>
584
585 </CoolingDevice>
586
587 </CoolingDevices>
588
589 </Platform>
590
591 </ThermalConfiguration>
592
593 Example 6: Similar to example 5, but write different speeds at
594 different temperatures.
595
596 <?xml version="1.0"?>
597
598 <ThermalConfiguration>
599
600 <Platform>
601
602 <Name>Use Fan control first then CPU throttle </Name>
603
604 <ProductName>*</ProductName>
605
606 <Preference>QUIET</Preference>
607
608 <ThermalZones>
609
610 <ThermalZone>
611
612 <Type>x86_pkg_temp</Type>
613
614 <TripPoints>
615
616 <Trip‐
617 Point>
618
619 <Sen‐
620 sorType>x86_pkg_temp</SensorType>
621
622 <Tem‐
623 perature>80000</Temperature>
624
625 <type>pas‐
626 sive</type>
627
628 <Cool‐
629 ingDevice>
630
631 <type>_fan_</type>
632
633 <Tar‐
634 getState>1</TargetState>
635
636 </Cool‐
637 ingDevice>
638
639 </Trip‐
640 Point>
641
642 <Trip‐
643 Point>
644
645 <Sen‐
646 sorType>x86_pkg_temp</SensorType>
647
648 <Tem‐
649 perature>85000</Temperature>
650
651 <type>pas‐
652 sive</type>
653
654 <Cool‐
655 ingDevice>
656
657 <type>_fan_</type>
658
659 <Tar‐
660 getState>2</TargetState>
661
662 </Cool‐
663 ingDevice>
664
665 </Trip‐
666 Point>
667
668 </TripPoints>
669
670 </ThermalZone>
671
672 </ThermalZones>
673
674 <CoolingDevices>
675
676 <CoolingDevice>
677
678 <Type>_fan_</Type>
679
680 <Path>/proc/acpi/ibm/fan</Path>
681
682 <WritePrefix>level </WritePrefix>
683
684 <MinState>0</MinState>
685
686 <MaxState>5</MaxState>
687
688 <DebouncePeriod>10</DebouncePeriod>
689
690 </CoolingDevice>
691
692 </CoolingDevices>
693
694 </Platform>
695
696 </ThermalConfiguration>
697