Skip to content

Commit 1b72607

Browse files
committed
Merge tag 'thermal-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control updates from Rafael Wysocki: "The majority of changes here are related to the general switch-over to using arrays of generic trip point structures registered along with a thermal zone instead of trip point callbacks (this has been done mostly by Daniel Lezcano with some help from yours truly on the Intel drivers front). Apart from that and the related reorganization of code, there are some enhancements of the existing driver and a new Mediatek Low Voltage Thermal Sensor (LVTS) driver. The Intel powerclamp undergoes a major rework so it will use the generic idle_inject facility for CPU idle time injection going forward and it will take additional module parameters for specifying the subset of CPUs to be affected by it (work done by Srinivas Pandruvada). Also included are assorted fixes and a whole bunch of cleanups. Specifics: - Rework a large bunch of drivers to use the generic thermal trip structure and use the opportunity to do more cleanups by removing unused functions from the OF code (Daniel Lezcano) - Remove core header inclusion from drivers (Daniel Lezcano) - Fix some locking issues related to the generic thermal trip rework (Johan Hovold) - Fix a crash when requesting the critical temperature on tegra, which is related to the generic trip point work (Jon Hunter) - Clean up thermal device unregistration code (Viresh Kumar) - Fix and clean up thermal control core initialization error code paths (Daniel Lezcano) - Relocate the trip points handling code into a separate file (Daniel Lezcano) - Make the thermal core fail registration of thermal zones and cooling devices if the thermal class has not been registered (Rafael Wysocki) - Add trip point initialization helper functions for ACPI-defined trip points and modify two thermal drivers to use them (Rafael Wysocki, Daniel Lezcano) - Make the core thermal control code use sysfs_emit_at() instead of scnprintf() where applicable (ye xingchen) - Consolidate code accessing the Intel TCC (Thermal Control Circuitry) MSRs by introducing library functions for that and making the TCC-related code in thermal drivers use them (Zhang Rui) - Enhance the x86_pkg_temp_thermal driver to support dynamic tjmax changes (Zhang Rui) - Address an "unsigned expression compared with zero" warning in the intel_soc_dts_iosf thermal driver (Yang Li) - Update comments regarding two functions in the Intel Menlow thermal driver (Deming Wang) - Use sysfs_emit_at() instead of scnprintf() in the int340x thermal driver (ye xingchen) - Make the intel_pch thermal driver support the Wellsburg PCH (Tim Zimmermann) - Modify the intel_pch and processor_thermal_device_pci thermal drivers use generic trip point tables instead of thermal zone trip point callbacks (Daniel Lezcano) - Add production mode attribute sysfs attribute to the int340x thermal driver (Srinivas Pandruvada) - Rework dynamic trip point updates handling and locking in the int340x thermal driver (Rafael Wysocki) - Make the int340x thermal driver use a generic trip points table instead of thermal zone trip point callbacks (Rafael Wysocki, Daniel Lezcano) - Clean up and improve the int340x thermal driver (Rafael Wysocki) - Simplify and clean up the intel_pch thermal driver (Rafael Wysocki) - Fix the Intel powerclamp thermal driver and make it use the common idle injection framework (Srinivas Pandruvada) - Add two module parameters, cpumask and max_idle, to the Intel powerclamp thermal driver to allow it to affect only a specific subset of CPUs instead of all of them (Srinivas Pandruvada) - Make the Intel quark_dts thermal driver Use generic trip point objects instead of its own trip point representation (Daniel Lezcano) - Add toctree entry for thermal documents and fix two issues in the Intel powerclamp driver documentation (Bagas Sanjaya) - Use strscpy() to instead of strncpy() in the thermal core (Xu Panda) - Fix thermal_sampling_exit() (Vincent Guittot) - Add Mediatek Low Voltage Thermal Sensor (LVTS) driver (Balsam Chihi) - Add r8a779g0 RCar support to the rcar_gen3 thermal driver (Geert Uytterhoeven) - Fix useless call to set_trips() when resuming in the rcar_gen3 thermal control driver and add interrupt support detection at init time to it (Niklas Söderlund) - Fix memory corruption in the hi3660 thermal driver (Yongqin Liu) - Fix include path for libnl3 in pkg-config file for libthermal (Vibhav Pant) - Remove syscfg-based driver for st as the platform is not supported any more (Alain Volmat)" * tag 'thermal-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (135 commits) thermal/drivers/st: Remove syscfg based driver thermal: Remove core header inclusion from drivers tools/lib/thermal: Fix include path for libnl3 in pkg-config file. thermal/drivers/hisi: Drop second sensor hi3660 thermal/drivers/rcar_gen3_thermal: Fix device initialization thermal/drivers/rcar_gen3_thermal: Create device local ops struct thermal/drivers/rcar_gen3_thermal: Do not call set_trips() when resuming thermal/drivers/rcar_gen3: Add support for R-Car V4H dt-bindings: thermal: rcar-gen3-thermal: Add r8a779g0 support thermal/drivers/mediatek: Add the Low Voltage Thermal Sensor driver dt-bindings: thermal: mediatek: Add LVTS thermal controllers thermal/drivers/mediatek: Relocate driver to mediatek folder tools/lib/thermal: Fix thermal_sampling_exit() Documentation: powerclamp: Fix numbered lists formatting Documentation: powerclamp: Escape wildcard in cpumask description Documentation: admin-guide: Add toctree entry for thermal docs thermal: intel: powerclamp: Add two module parameters Documentation: admin-guide: Move intel_powerclamp documentation thermal: core: Use sysfs_emit_at() instead of scnprintf() thermal: intel: powerclamp: Fix duration module parameter ...
2 parents 88af9b1 + 6828e40 commit 1b72607

File tree

94 files changed

+4143
-3176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4143
-3176
lines changed

Documentation/admin-guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ configure specific aspects of kernel behavior to your liking.
116116
svga
117117
syscall-user-dispatch
118118
sysrq
119+
thermal/index
119120
thunderbolt
120121
ufs
121122
unicode
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=================
2+
Thermal Subsystem
3+
=================
4+
5+
.. toctree::
6+
:maxdepth: 1
7+
8+
intel_powerclamp

Documentation/driver-api/thermal/intel_powerclamp.rst renamed to Documentation/admin-guide/thermal/intel_powerclamp.rst

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ By:
2626
- Generic Thermal Layer (sysfs)
2727
- Kernel APIs (TBD)
2828
29+
(*) Module Parameters
30+
2931
INTRODUCTION
3032
============
3133

@@ -153,13 +155,15 @@ b) determine the amount of compensation needed at each target ratio
153155
Compensation to each target ratio consists of two parts:
154156

155157
a) steady state error compensation
156-
This is to offset the error occurring when the system can
157-
enter idle without extra wakeups (such as external interrupts).
158+
159+
This is to offset the error occurring when the system can
160+
enter idle without extra wakeups (such as external interrupts).
158161

159162
b) dynamic error compensation
160-
When an excessive amount of wakeups occurs during idle, an
161-
additional idle ratio can be added to quiet interrupts, by
162-
slowing down CPU activities.
163+
164+
When an excessive amount of wakeups occurs during idle, an
165+
additional idle ratio can be added to quiet interrupts, by
166+
slowing down CPU activities.
163167

164168
A debugfs file is provided for the user to examine compensation
165169
progress and results, such as on a Westmere system::
@@ -281,6 +285,7 @@ cur_state returns value -1 instead of 0 which is to avoid confusing
281285
100% busy state with the disabled state.
282286

283287
Example usage:
288+
284289
- To inject 25% idle time::
285290

286291
$ sudo sh -c "echo 25 > /sys/class/thermal/cooling_device80/cur_state
@@ -318,3 +323,23 @@ device, a PID based userspace thermal controller can manage to
318323
control CPU temperature effectively, when no other thermal influence
319324
is added. For example, a UltraBook user can compile the kernel under
320325
certain temperature (below most active trip points).
326+
327+
Module Parameters
328+
=================
329+
330+
``cpumask`` (RW)
331+
A bit mask of CPUs to inject idle. The format of the bitmask is same as
332+
used in other subsystems like in /proc/irq/\*/smp_affinity. The mask is
333+
comma separated 32 bit groups. Each CPU is one bit. For example for a 256
334+
CPU system the full mask is:
335+
ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff
336+
337+
The rightmost mask is for CPU 0-32.
338+
339+
``max_idle`` (RW)
340+
Maximum injected idle time to the total CPU time ratio in percent range
341+
from 1 to 100. Even if the cooling device max_state is always 100 (100%),
342+
this parameter allows to add a max idle percent limit. The default is 50,
343+
to match the current implementation of powerclamp driver. Also doesn't
344+
allow value more than 75, if the cpumask includes every CPU present in
345+
the system.
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/mediatek,lvts-thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek SoC Low Voltage Thermal Sensor (LVTS)
8+
9+
maintainers:
10+
- Balsam CHIHI <[email protected]>
11+
12+
description: |
13+
LVTS is a thermal management architecture composed of three subsystems,
14+
a Sensing device - Thermal Sensing Micro Circuit Unit (TSMCU),
15+
a Converter - Low Voltage Thermal Sensor converter (LVTS), and
16+
a Digital controller (LVTS_CTRL).
17+
18+
properties:
19+
compatible:
20+
enum:
21+
- mediatek,mt8192-lvts-ap
22+
- mediatek,mt8192-lvts-mcu
23+
- mediatek,mt8195-lvts-ap
24+
- mediatek,mt8195-lvts-mcu
25+
26+
reg:
27+
maxItems: 1
28+
29+
interrupts:
30+
maxItems: 1
31+
32+
clocks:
33+
maxItems: 1
34+
35+
resets:
36+
maxItems: 1
37+
description: LVTS reset for clearing temporary data on AP/MCU.
38+
39+
nvmem-cells:
40+
minItems: 1
41+
items:
42+
- description: Calibration eFuse data 1 for LVTS
43+
- description: Calibration eFuse data 2 for LVTS
44+
45+
nvmem-cell-names:
46+
minItems: 1
47+
items:
48+
- const: lvts-calib-data-1
49+
- const: lvts-calib-data-2
50+
51+
"#thermal-sensor-cells":
52+
const: 1
53+
54+
allOf:
55+
- $ref: thermal-sensor.yaml#
56+
57+
- if:
58+
properties:
59+
compatible:
60+
contains:
61+
enum:
62+
- mediatek,mt8192-lvts-ap
63+
- mediatek,mt8192-lvts-mcu
64+
then:
65+
properties:
66+
nvmem-cells:
67+
maxItems: 1
68+
69+
nvmem-cell-names:
70+
maxItems: 1
71+
72+
- if:
73+
properties:
74+
compatible:
75+
contains:
76+
enum:
77+
- mediatek,mt8195-lvts-ap
78+
- mediatek,mt8195-lvts-mcu
79+
then:
80+
properties:
81+
nvmem-cells:
82+
minItems: 2
83+
84+
nvmem-cell-names:
85+
minItems: 2
86+
87+
required:
88+
- compatible
89+
- reg
90+
- interrupts
91+
- clocks
92+
- resets
93+
- nvmem-cells
94+
- nvmem-cell-names
95+
- "#thermal-sensor-cells"
96+
97+
additionalProperties: false
98+
99+
examples:
100+
- |
101+
#include <dt-bindings/interrupt-controller/arm-gic.h>
102+
#include <dt-bindings/clock/mt8195-clk.h>
103+
#include <dt-bindings/reset/mt8195-resets.h>
104+
#include <dt-bindings/thermal/mediatek,lvts-thermal.h>
105+
106+
soc {
107+
#address-cells = <2>;
108+
#size-cells = <2>;
109+
110+
lvts_mcu: thermal-sensor@11278000 {
111+
compatible = "mediatek,mt8195-lvts-mcu";
112+
reg = <0 0x11278000 0 0x1000>;
113+
interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH 0>;
114+
clocks = <&infracfg_ao CLK_INFRA_AO_THERM>;
115+
resets = <&infracfg_ao MT8195_INFRA_RST4_THERM_CTRL_MCU_SWRST>;
116+
nvmem-cells = <&lvts_efuse_data1 &lvts_efuse_data2>;
117+
nvmem-cell-names = "lvts-calib-data-1", "lvts-calib-data-2";
118+
#thermal-sensor-cells = <1>;
119+
};
120+
};
121+
122+
thermal_zones: thermal-zones {
123+
cpu0-thermal {
124+
polling-delay = <1000>;
125+
polling-delay-passive = <250>;
126+
thermal-sensors = <&lvts_mcu MT8195_MCU_LITTLE_CPU0>;
127+
128+
trips {
129+
cpu0_alert: trip-alert {
130+
temperature = <85000>;
131+
hysteresis = <2000>;
132+
type = "passive";
133+
};
134+
135+
cpu0_crit: trip-crit {
136+
temperature = <100000>;
137+
hysteresis = <2000>;
138+
type = "critical";
139+
};
140+
};
141+
};
142+
};

Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ properties:
1313
enum:
1414
- qcom,spmi-adc-tm5
1515
- qcom,spmi-adc-tm5-gen2
16+
- qcom,adc-tm7 # Incomplete / subject to change
1617

1718
reg:
1819
maxItems: 1

0 commit comments

Comments
 (0)