Skip to content

Commit fb3da48

Browse files
committed
Merge branch 'thermal/next' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal management updates from Zhang Rui: - Fix a deadlock regression in thermal core framework, which was introduced in 5.3 (Wei Wang) - Initialize thermal control framework earlier to enable thermal mitigation during boot (Amit Kucheria) - Convert the Intelligent Power Allocator (IPA) thermal governor to follow the generic PM_EM instead of its own Energy Model (Quentin Perret) - Introduce a new Amlogic soc thermal driver (Guillaume La Roque) - Add interrupt support for tsens thermal driver (Amit Kucheria) - Add support for MSM8956/8976 in tsens thermal driver (AngeloGioacchino Del Regno) - Add support for r8a774b1 in rcar thermal driver (Biju Das) - Add support for Thermal Monitor Unit v2 in qoriq thermal driver (Yuantian Tang) - Some other fixes/cleanups on thermal core framework and soc thermal drivers (Colin Ian King, Daniel Lezcano, Hsin-Yi Wang, Tian Tao) * 'thermal/next' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (32 commits) thermal: Fix deadlock in thermal thermal_zone_device_check thermal: cpu_cooling: Migrate to using the EM framework thermal: cpu_cooling: Make the power-related code depend on IPA PM / EM: Declare EM data types unconditionally arm64: defconfig: Enable CONFIG_ENERGY_MODEL drivers: thermal: tsens: fix potential integer overflow on multiply thermal: cpu_cooling: Reorder the header file thermal: cpu_cooling: Remove pointless dependency on CONFIG_OF thermal: no need to set .owner when using module_platform_driver thermal: qcom: tsens-v1: Fix kfree of a non-pointer value cpufreq: qcom-hw: Move driver initialization earlier clk: qcom: Initialize clock drivers earlier cpufreq: Initialize cpufreq-dt driver earlier cpufreq: Initialize the governors in core_initcall thermal: Initialize thermal subsystem earlier thermal: Remove netlink support dt: thermal: tsens: Document compatible for MSM8976/56 thermal: qcom: tsens-v1: Add support for MSM8956 and MSM8976 MAINTAINERS: add entry for Amlogic Thermal driver thermal: amlogic: Add thermal driver to support G12 SoCs ...
2 parents 5ecc9d1 + 163b00c commit fb3da48

37 files changed

+1878
-589
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/amlogic,thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Amlogic Thermal
8+
9+
maintainers:
10+
- Guillaume La Roque <[email protected]>
11+
12+
description: Binding for Amlogic Thermal
13+
14+
properties:
15+
compatible:
16+
items:
17+
- enum:
18+
- amlogic,g12a-cpu-thermal
19+
- amlogic,g12a-ddr-thermal
20+
- const: amlogic,g12a-thermal
21+
22+
reg:
23+
maxItems: 1
24+
25+
interrupts:
26+
maxItems: 1
27+
28+
clocks:
29+
maxItems: 1
30+
31+
amlogic,ao-secure:
32+
description: phandle to the ao-secure syscon
33+
$ref: '/schemas/types.yaml#/definitions/phandle'
34+
35+
36+
required:
37+
- compatible
38+
- reg
39+
- interrupts
40+
- clocks
41+
- amlogic,ao-secure
42+
43+
examples:
44+
- |
45+
cpu_temp: temperature-sensor@ff634800 {
46+
compatible = "amlogic,g12a-cpu-thermal",
47+
"amlogic,g12a-thermal";
48+
reg = <0xff634800 0x50>;
49+
interrupts = <0x0 0x24 0x0>;
50+
clocks = <&clk 164>;
51+
#thermal-sensor-cells = <0>;
52+
amlogic,ao-secure = <&sec_AO>;
53+
};
54+
...

Documentation/devicetree/bindings/thermal/qcom-tsens.txt

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
# Copyright 2019 Linaro Ltd.
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/thermal/qcom-tsens.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: QCOM SoC Temperature Sensor (TSENS)
9+
10+
maintainers:
11+
- Amit Kucheria <[email protected]>
12+
13+
description: |
14+
QCOM SoCs have TSENS IP to allow temperature measurement. There are currently
15+
three distinct major versions of the IP that is supported by a single driver.
16+
The IP versions are named v0.1, v1 and v2 in the driver, where v0.1 captures
17+
everything before v1 when there was no versioning information.
18+
19+
properties:
20+
compatible:
21+
oneOf:
22+
- description: v0.1 of TSENS
23+
items:
24+
- enum:
25+
- qcom,msm8916-tsens
26+
- qcom,msm8974-tsens
27+
- const: qcom,tsens-v0_1
28+
29+
- description: v1 of TSENS
30+
items:
31+
- enum:
32+
- qcom,msm8976-tsens
33+
- qcom,qcs404-tsens
34+
- const: qcom,tsens-v1
35+
36+
- description: v2 of TSENS
37+
items:
38+
- enum:
39+
- qcom,msm8996-tsens
40+
- qcom,msm8998-tsens
41+
- qcom,sdm845-tsens
42+
- const: qcom,tsens-v2
43+
44+
reg:
45+
maxItems: 2
46+
items:
47+
- description: TM registers
48+
- description: SROT registers
49+
50+
nvmem-cells:
51+
minItems: 1
52+
maxItems: 2
53+
description:
54+
Reference to an nvmem node for the calibration data
55+
56+
nvmem-cells-names:
57+
minItems: 1
58+
maxItems: 2
59+
items:
60+
- enum:
61+
- caldata
62+
- calsel
63+
64+
"#qcom,sensors":
65+
allOf:
66+
- $ref: /schemas/types.yaml#/definitions/uint32
67+
- minimum: 1
68+
- maximum: 16
69+
description:
70+
Number of sensors enabled on this platform
71+
72+
"#thermal-sensor-cells":
73+
const: 1
74+
description:
75+
Number of cells required to uniquely identify the thermal sensors. Since
76+
we have multiple sensors this is set to 1
77+
78+
allOf:
79+
- if:
80+
properties:
81+
compatible:
82+
contains:
83+
enum:
84+
- qcom,msm8916-tsens
85+
- qcom,msm8974-tsens
86+
- qcom,msm8976-tsens
87+
- qcom,qcs404-tsens
88+
- qcom,tsens-v0_1
89+
- qcom,tsens-v1
90+
then:
91+
properties:
92+
interrupts:
93+
items:
94+
- description: Combined interrupt if upper or lower threshold crossed
95+
interrupt-names:
96+
items:
97+
- const: uplow
98+
99+
else:
100+
properties:
101+
interrupts:
102+
items:
103+
- description: Combined interrupt if upper or lower threshold crossed
104+
- description: Interrupt if critical threshold crossed
105+
interrupt-names:
106+
items:
107+
- const: uplow
108+
- const: critical
109+
110+
required:
111+
- compatible
112+
- reg
113+
- "#qcom,sensors"
114+
- interrupts
115+
- interrupt-names
116+
- "#thermal-sensor-cells"
117+
118+
examples:
119+
- |
120+
#include <dt-bindings/interrupt-controller/arm-gic.h>
121+
// Example 1 (legacy: for pre v1 IP):
122+
tsens1: thermal-sensor@900000 {
123+
compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
124+
reg = <0x4a9000 0x1000>, /* TM */
125+
<0x4a8000 0x1000>; /* SROT */
126+
127+
nvmem-cells = <&tsens_caldata>, <&tsens_calsel>;
128+
nvmem-cell-names = "caldata", "calsel";
129+
130+
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
131+
interrupt-names = "uplow";
132+
133+
#qcom,sensors = <5>;
134+
#thermal-sensor-cells = <1>;
135+
};
136+
137+
- |
138+
#include <dt-bindings/interrupt-controller/arm-gic.h>
139+
// Example 2 (for any platform containing v1 of the TSENS IP):
140+
tsens2: thermal-sensor@4a9000 {
141+
compatible = "qcom,qcs404-tsens", "qcom,tsens-v1";
142+
reg = <0x004a9000 0x1000>, /* TM */
143+
<0x004a8000 0x1000>; /* SROT */
144+
145+
nvmem-cells = <&tsens_caldata>;
146+
nvmem-cell-names = "calib";
147+
148+
interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
149+
interrupt-names = "uplow";
150+
151+
#qcom,sensors = <10>;
152+
#thermal-sensor-cells = <1>;
153+
};
154+
155+
- |
156+
#include <dt-bindings/interrupt-controller/arm-gic.h>
157+
// Example 3 (for any platform containing v2 of the TSENS IP):
158+
tsens3: thermal-sensor@c263000 {
159+
compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
160+
reg = <0xc263000 0x1ff>,
161+
<0xc222000 0x1ff>;
162+
163+
interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>,
164+
<GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH>;
165+
interrupt-names = "uplow", "critical";
166+
167+
#qcom,sensors = <13>;
168+
#thermal-sensor-cells = <1>;
169+
};
170+
...

Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties:
88
- compatible : "renesas,<soctype>-thermal",
99
Examples with soctypes are:
1010
- "renesas,r8a774a1-thermal" (RZ/G2M)
11+
- "renesas,r8a774b1-thermal" (RZ/G2N)
1112
- "renesas,r8a7795-thermal" (R-Car H3)
1213
- "renesas,r8a7796-thermal" (R-Car M3-W)
1314
- "renesas,r8a77965-thermal" (R-Car M3-N)

Documentation/driver-api/thermal/sysfs-api.rst

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -725,24 +725,10 @@ method, the sys I/F structure will be built like this::
725725
|---temp1_input: 37000
726726
|---temp1_crit: 100000
727727

728-
4. Event Notification
728+
4. Export Symbol APIs
729729
=====================
730730

731-
The framework includes a simple notification mechanism, in the form of a
732-
netlink event. Netlink socket initialization is done during the _init_
733-
of the framework. Drivers which intend to use the notification mechanism
734-
just need to call thermal_generate_netlink_event() with two arguments viz
735-
(originator, event). The originator is a pointer to struct thermal_zone_device
736-
from where the event has been originated. An integer which represents the
737-
thermal zone device will be used in the message to identify the zone. The
738-
event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL,
739-
THERMAL_DEV_FAULT}. Notification can be sent when the current temperature
740-
crosses any of the configured thresholds.
741-
742-
5. Export Symbol APIs
743-
=====================
744-
745-
5.1. get_tz_trend
731+
4.1. get_tz_trend
746732
-----------------
747733

748734
This function returns the trend of a thermal zone, i.e the rate of change
@@ -751,14 +737,14 @@ are supposed to implement the callback. If they don't, the thermal
751737
framework calculated the trend by comparing the previous and the current
752738
temperature values.
753739

754-
5.2. get_thermal_instance
740+
4.2. get_thermal_instance
755741
-------------------------
756742

757743
This function returns the thermal_instance corresponding to a given
758744
{thermal_zone, cooling_device, trip_point} combination. Returns NULL
759745
if such an instance does not exist.
760746

761-
5.3. thermal_notify_framework
747+
4.3. thermal_notify_framework
762748
-----------------------------
763749

764750
This function handles the trip events from sensor drivers. It starts
@@ -768,14 +754,14 @@ and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
768754
The throttling policy is based on the configured platform data; if no
769755
platform data is provided, this uses the step_wise throttling policy.
770756

771-
5.4. thermal_cdev_update
757+
4.4. thermal_cdev_update
772758
------------------------
773759

774760
This function serves as an arbitrator to set the state of a cooling
775761
device. It sets the cooling device to the deepest cooling state if
776762
possible.
777763

778-
6. thermal_emergency_poweroff
764+
5. thermal_emergency_poweroff
779765
=============================
780766

781767
On an event of critical trip temperature crossing. Thermal framework

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13688,6 +13688,7 @@ L: [email protected]
1368813688
1368913689
S: Maintained
1369013690
F: drivers/thermal/qcom/
13691+
F: Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
1369113692

1369213693
QUALCOMM VENUS VIDEO ACCELERATOR DRIVER
1369313694
M: Stanimir Varbanov <[email protected]>
@@ -16310,6 +16311,15 @@ F: Documentation/driver-api/thermal/cpu-cooling-api.rst
1631016311
F: drivers/thermal/cpu_cooling.c
1631116312
F: include/linux/cpu_cooling.h
1631216313

16314+
THERMAL DRIVER FOR AMLOGIC SOCS
16315+
M: Guillaume La Roque <[email protected]>
16316+
16317+
16318+
W: http://linux-meson.com/
16319+
S: Supported
16320+
F: drivers/thermal/amlogic_thermal.c
16321+
F: Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml
16322+
1631316323
THINKPAD ACPI EXTRAS DRIVER
1631416324
M: Henrique de Moraes Holschuh <[email protected]>
1631516325

arch/arm64/configs/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ CONFIG_COMPAT=y
7171
CONFIG_RANDOMIZE_BASE=y
7272
CONFIG_HIBERNATION=y
7373
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
74+
CONFIG_ENERGY_MODEL=y
7475
CONFIG_ARM_CPUIDLE=y
7576
CONFIG_ARM_PSCI_CPUIDLE=y
7677
CONFIG_CPU_FREQ=y

drivers/clk/qcom/clk-rpmh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static int __init clk_rpmh_init(void)
500500
{
501501
return platform_driver_register(&clk_rpmh_driver);
502502
}
503-
subsys_initcall(clk_rpmh_init);
503+
core_initcall(clk_rpmh_init);
504504

505505
static void __exit clk_rpmh_exit(void)
506506
{

0 commit comments

Comments
 (0)