Skip to content

Commit 583f2bc

Browse files
committed
Merge tag 'thermal-v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal updates from Daniel Lezcano: - Remove duplicate error message for the amlogic driver (Tang Bin) - Fix spellos in comments for the tegra and sun8i (Bhaskar Chowdhury) - Add the missing fifth node on the rcar_gen3 sensor (Niklas Söderlund) - Remove duplicate include in ti-bandgap (Zhang Yunkai) - Assign error code in the error path in the function thermal_of_populate_bind_params() (Jia-Ju Bai) - Fix spelling mistake in a comment 'disabed' -> 'disabled' (Colin Ian King) - Use the device name instead of auto-numbering for a better identification of the cooling device (Daniel Lezcano) - Improve a bit the division accuracy in the power allocator governor (Jeson Gao) - Enable the missing third sensor on msm8976 (Konrad Dybcio) - Add QCom tsens driver co-maintainer (Thara Gopinath) - Fix memory leak and use after free errors in the core code (Daniel Lezcano) - Add the MDM9607 compatible bindings (Konrad Dybcio) - Fix trivial spello in the copyright name for Hisilicon (Hao Fang) - Fix negative index array access when converting the frequency to power in the energy model (Brian-sy Yang) - Add support for Gen2 new PMIC support for Qcom SPMI (David Collins) - Update maintainer file for CPU cooling device section (Lukasz Luba) - Fix missing put_device on error in the Qcom tsens driver (Guangqing Zhu) - Add compatible DT binding for sm8350 (Robert Foss) - Add support for the MDM9607's tsens driver (Konrad Dybcio) - Remove duplicate error messages in thermal_mmio and the bcm2835 driver (Ruiqi Gong) - Add the Thermal Temperature Cooling driver (Zhang Rui) - Remove duplicate error messages in the Hisilicon sensor driver (Ye Bin) - Use the devm_platform_ioremap_resource_byname() function instead of a couple of corresponding calls (dingsenjie) - Sort the headers alphabetically in the ti-bandgap driver (Zhen Lei) - Add missing property in the DT thermal sensor binding (Rafał Miłecki) - Remove dead code in the ti-bandgap sensor driver (Lin Ruizhe) - Convert the BRCM DT bindings to the yaml schema (Rafał Miłecki) - Replace the thermal_notify_framework() call by a call to the thermal_zone_device_update() function. Remove the function as well as the corresponding documentation (Thara Gopinath) - Add support for the ipq8064-tsens sensor along with a set of cleanups and code preparation (Ansuel Smith) - Add a lockless __thermal_cdev_update() function to improve the locking scheme in the core code and governors (Lukasz Luba) - Fix multiple cooling device notification changes (Lukasz Luba) - Remove unneeded variable initialization (Colin Ian King) * tag 'thermal-v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (55 commits) thermal/drivers/mtk_thermal: Remove redundant initializations of several variables thermal/core/power allocator: Use the lockless __thermal_cdev_update() function thermal/core/fair share: Use the lockless __thermal_cdev_update() function thermal/core/fair share: Lock the thermal zone while looping over instances thermal/core/power_allocator: Update once cooling devices when temp is low thermal/core/power_allocator: Maintain the device statistics from going stale thermal/core: Create a helper __thermal_cdev_update() without a lock dt-bindings: thermal: tsens: Document ipq8064 bindings thermal/drivers/tsens: Add support for ipq8064-tsens thermal/drivers/tsens: Drop unused define for msm8960 thermal/drivers/tsens: Replace custom 8960 apis with generic apis thermal/drivers/tsens: Fix bug in sensor enable for msm8960 thermal/drivers/tsens: Use init_common for msm8960 thermal/drivers/tsens: Add VER_0 tsens version thermal/drivers/tsens: Convert msm8960 to reg_field thermal/drivers/tsens: Don't hardcode sensor slope Documentation: driver-api: thermal: Remove thermal_notify_framework from documentation thermal/core: Remove thermal_notify_framework iwlwifi: mvm: tt: Replace thermal_notify_framework dt-bindings: thermal: brcm,ns-thermal: Convert to the json-schema ...
2 parents 5d6a1b8 + c310e54 commit 583f2bc

38 files changed

+863
-446
lines changed

Documentation/devicetree/bindings/thermal/brcm,ns-thermal.txt

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/thermal/brcm,ns-thermal.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Broadcom Northstar Thermal
8+
9+
maintainers:
10+
- Rafał Miłecki <[email protected]>
11+
12+
description:
13+
Thermal sensor that is part of Northstar's DMU (Device Management Unit).
14+
15+
allOf:
16+
- $ref: thermal-sensor.yaml#
17+
18+
properties:
19+
compatible:
20+
const: brcm,ns-thermal
21+
22+
reg:
23+
description: PVTMON registers range
24+
maxItems: 1
25+
26+
"#thermal-sensor-cells":
27+
const: 0
28+
29+
unevaluatedProperties: false
30+
31+
required:
32+
- reg
33+
34+
examples:
35+
- |
36+
thermal: thermal@1800c2c0 {
37+
compatible = "brcm,ns-thermal";
38+
reg = <0x1800c2c0 0x10>;
39+
#thermal-sensor-cells = <0>;
40+
};
41+
42+
thermal-zones {
43+
cpu-thermal {
44+
polling-delay-passive = <0>;
45+
polling-delay = <1000>;
46+
coefficients = <(-556) 418000>;
47+
thermal-sensors = <&thermal>;
48+
49+
trips {
50+
cpu-crit {
51+
temperature = <125000>;
52+
hysteresis = <0>;
53+
type = "critical";
54+
};
55+
};
56+
57+
cooling-maps {
58+
};
59+
};
60+
};

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

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ description: |
1919
properties:
2020
compatible:
2121
oneOf:
22+
- description: msm9860 TSENS based
23+
items:
24+
- enum:
25+
- qcom,ipq8064-tsens
26+
2227
- description: v0.1 of TSENS
2328
items:
2429
- enum:
30+
- qcom,mdm9607-tsens
2531
- qcom,msm8916-tsens
2632
- qcom,msm8939-tsens
2733
- qcom,msm8974-tsens
@@ -43,6 +49,7 @@ properties:
4349
- qcom,sdm845-tsens
4450
- qcom,sm8150-tsens
4551
- qcom,sm8250-tsens
52+
- qcom,sm8350-tsens
4653
- const: qcom,tsens-v2
4754

4855
reg:
@@ -73,7 +80,9 @@ properties:
7380
maxItems: 2
7481
items:
7582
- const: calib
76-
- const: calib_sel
83+
- enum:
84+
- calib_backup
85+
- calib_sel
7786

7887
"#qcom,sensors":
7988
description:
@@ -88,12 +97,21 @@ properties:
8897
Number of cells required to uniquely identify the thermal sensors. Since
8998
we have multiple sensors this is set to 1
9099

100+
required:
101+
- compatible
102+
- interrupts
103+
- interrupt-names
104+
- "#thermal-sensor-cells"
105+
- "#qcom,sensors"
106+
91107
allOf:
92108
- if:
93109
properties:
94110
compatible:
95111
contains:
96112
enum:
113+
- qcom,ipq8064-tsens
114+
- qcom,mdm9607-tsens
97115
- qcom,msm8916-tsens
98116
- qcom,msm8974-tsens
99117
- qcom,msm8976-tsens
@@ -114,17 +132,42 @@ allOf:
114132
interrupt-names:
115133
minItems: 2
116134

117-
required:
118-
- compatible
119-
- reg
120-
- "#qcom,sensors"
121-
- interrupts
122-
- interrupt-names
123-
- "#thermal-sensor-cells"
135+
- if:
136+
properties:
137+
compatible:
138+
contains:
139+
enum:
140+
- qcom,tsens-v0_1
141+
- qcom,tsens-v1
142+
- qcom,tsens-v2
143+
144+
then:
145+
required:
146+
- reg
124147

125148
additionalProperties: false
126149

127150
examples:
151+
- |
152+
#include <dt-bindings/interrupt-controller/arm-gic.h>
153+
// Example msm9860 based SoC (ipq8064):
154+
gcc: clock-controller {
155+
156+
/* ... */
157+
158+
tsens: thermal-sensor {
159+
compatible = "qcom,ipq8064-tsens";
160+
161+
nvmem-cells = <&tsens_calib>, <&tsens_calib_backup>;
162+
nvmem-cell-names = "calib", "calib_backup";
163+
interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
164+
interrupt-names = "uplow";
165+
166+
#qcom,sensors = <11>;
167+
#thermal-sensor-cells = <1>;
168+
};
169+
};
170+
128171
- |
129172
#include <dt-bindings/interrupt-controller/arm-gic.h>
130173
// Example 1 (legacy: for pre v1 IP):

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

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ properties:
2828
- renesas,r8a77980-thermal # R-Car V3H
2929
- renesas,r8a779a0-thermal # R-Car V3U
3030

31-
reg:
32-
minItems: 2
33-
maxItems: 4
34-
items:
35-
- description: TSC1 registers
36-
- description: TSC2 registers
37-
- description: TSC3 registers
38-
- description: TSC4 registers
31+
reg: true
3932

4033
interrupts:
4134
items:
@@ -71,8 +64,25 @@ if:
7164
enum:
7265
- renesas,r8a779a0-thermal
7366
then:
67+
properties:
68+
reg:
69+
minItems: 2
70+
maxItems: 3
71+
items:
72+
- description: TSC1 registers
73+
- description: TSC2 registers
74+
- description: TSC3 registers
7475
required:
7576
- interrupts
77+
else:
78+
properties:
79+
reg:
80+
items:
81+
- description: TSC0 registers
82+
- description: TSC1 registers
83+
- description: TSC2 registers
84+
- description: TSC3 registers
85+
- description: TSC4 registers
7686

7787
additionalProperties: false
7888

@@ -111,3 +121,20 @@ examples:
111121
};
112122
};
113123
};
124+
- |
125+
#include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
126+
#include <dt-bindings/interrupt-controller/arm-gic.h>
127+
#include <dt-bindings/power/r8a779a0-sysc.h>
128+
129+
tsc_r8a779a0: thermal@e6190000 {
130+
compatible = "renesas,r8a779a0-thermal";
131+
reg = <0xe6190000 0x200>,
132+
<0xe6198000 0x200>,
133+
<0xe61a0000 0x200>,
134+
<0xe61a8000 0x200>,
135+
<0xe61b0000 0x200>;
136+
clocks = <&cpg CPG_MOD 919>;
137+
power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
138+
resets = <&cpg 919>;
139+
#thermal-sensor-cells = <1>;
140+
};

Documentation/devicetree/bindings/thermal/thermal-sensor.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ properties:
3636
containing several internal sensors.
3737
enum: [0, 1]
3838

39+
required:
40+
- "#thermal-sensor-cells"
41+
3942
additionalProperties: true
4043

4144
examples:

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -730,17 +730,7 @@ This function returns the thermal_instance corresponding to a given
730730
{thermal_zone, cooling_device, trip_point} combination. Returns NULL
731731
if such an instance does not exist.
732732

733-
4.3. thermal_notify_framework
734-
-----------------------------
735-
736-
This function handles the trip events from sensor drivers. It starts
737-
throttling the cooling devices according to the policy configured.
738-
For CRITICAL and HOT trip points, this notifies the respective drivers,
739-
and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
740-
The throttling policy is based on the configured platform data; if no
741-
platform data is provided, this uses the step_wise throttling policy.
742-
743-
4.4. thermal_cdev_update
733+
4.3. thermal_cdev_update
744734
------------------------
745735

746736
This function serves as an arbitrator to set the state of a cooling

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15197,6 +15197,7 @@ F: include/linux/if_rmnet.h
1519715197

1519815198
QUALCOMM TSENS THERMAL DRIVER
1519915199
M: Amit Kucheria <[email protected]>
15200+
M: Thara Gopinath <[email protected]>
1520015201
1520115202
1520215203
S: Maintained
@@ -18101,7 +18102,7 @@ THERMAL/CPU_COOLING
1810118102
M: Amit Daniel Kachhap <[email protected]>
1810218103
M: Daniel Lezcano <[email protected]>
1810318104
M: Viresh Kumar <[email protected]>
18104-
M: Javi Merino <[email protected]>
18105+
R: Lukasz Luba <[email protected]>
1810518106
1810618107
S: Supported
1810718108
F: Documentation/driver-api/thermal/cpu-cooling-api.rst

drivers/net/ethernet/mellanox/mlxsw/core_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int mlxsw_get_cooling_device_idx(struct mlxsw_thermal *thermal,
132132
/* Allow mlxsw thermal zone binding to an external cooling device */
133133
for (i = 0; i < ARRAY_SIZE(mlxsw_thermal_external_allowed_cdev); i++) {
134134
if (strnstr(cdev->type, mlxsw_thermal_external_allowed_cdev[i],
135-
sizeof(cdev->type)))
135+
strlen(cdev->type)))
136136
return 0;
137137
}
138138

drivers/net/wireless/intel/iwlwifi/mvm/tt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ void iwl_mvm_temp_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
146146
if (mvm->tz_device.tzone) {
147147
struct iwl_mvm_thermal_device *tz_dev = &mvm->tz_device;
148148

149-
thermal_notify_framework(tz_dev->tzone,
150-
tz_dev->fw_trips_index[ths_crossed]);
149+
thermal_zone_device_update(tz_dev->tzone,
150+
THERMAL_TRIP_VIOLATED);
151151
}
152152
#endif /* CONFIG_THERMAL */
153153
}

drivers/thermal/amlogic_thermal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,8 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
254254
platform_set_drvdata(pdev, pdata);
255255

256256
base = devm_platform_ioremap_resource(pdev, 0);
257-
if (IS_ERR(base)) {
258-
dev_err(dev, "failed to get io address\n");
257+
if (IS_ERR(base))
259258
return PTR_ERR(base);
260-
}
261259

262260
pdata->regmap = devm_regmap_init_mmio(dev, base,
263261
pdata->data->regmap_config);

0 commit comments

Comments
 (0)