Skip to content

Commit 667de5c

Browse files
committed
Merge tag 'thermal-6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more thermal control updates from Rafael Wysocki: "These are mostly cleanups on top of the previously merged thermal control changes plus some driver fixes and the removal of the Intel Menlow thermal driver. Specifics: - Add compatible DT bindings for imx6sll and imx6ul to fix a dtbs check warning (Stefan Wahren) - Update the example in the DT bindings to reflect changes with the ADC node name for QCom TM and TM5 (Marijn Suijten) - Fix comments for the cpuidle_cooling_register() function to match the function prototype (Chenggang Wang) - Fix inconsistent temperature read and some Mediatek variant board reboot by reverting a change and handling the temperature differently (AngeloGioacchino Del Regno) - Fix a memory leak in the initialization error path for the Mediatek driver (Kang Chen) - Use of_address_to_resource() in the Mediatek driver (Rob Herring) - Fix unit address in the QCom tsens driver DT bindings (Krzysztof Kozlowski) - Clean up the step-wise thermal governor (Zhang Rui) - Introduce thermal_zone_device() for accessing the device field of struct thermal_zone_device and two drivers use it (Daniel Lezcano) - Clean up the ACPI thermal driver a bit (Daniel Lezcano) - Delete the thermal driver for Intel Menlow platforms that is not expected to have any users (Rafael Wysocki)" * tag 'thermal-6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: intel: menlow: Get rid of this driver ACPI: thermal: Move to dedicated function sysfs extra attr creation ACPI: thermal: Use thermal_zone_device() thermal: intel: pch_thermal: Use thermal driver device to write a trace thermal: core: Encapsulate tz->device field thermal: gov_step_wise: Adjust code logic to match comment thermal: gov_step_wise: Delete obsolete comment dt-bindings: thermal: qcom-tsens: Correct unit address thermal/drivers/mediatek: Use of_address_to_resource() thermal/drivers/mediatek: Change clk_prepare_enable to devm_clk_get_enabled in mtk_thermal_probe thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe thermal/drivers/mediatek: Add temperature constraints to validate read Revert "thermal/drivers/mediatek: Add delay after thermal banks initialization" thermal/drivers/cpuidle_cooling: Delete unmatched comments dt-bindings: thermal: Use generic ADC node name in examples dt-bindings: imx-thermal: Add imx6sll and imx6ul compatible
2 parents 89b7fd5 + 53389ed commit 667de5c

14 files changed

Lines changed: 110 additions & 627 deletions

File tree

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ maintainers:
1212

1313
properties:
1414
compatible:
15-
enum:
16-
- fsl,imx6q-tempmon
17-
- fsl,imx6sx-tempmon
18-
- fsl,imx7d-tempmon
15+
oneOf:
16+
- enum:
17+
- fsl,imx6q-tempmon
18+
- fsl,imx6sx-tempmon
19+
- fsl,imx7d-tempmon
20+
- items:
21+
- enum:
22+
- fsl,imx6sll-tempmon
23+
- fsl,imx6ul-tempmon
24+
- const: fsl,imx6sx-tempmon
1925

2026
interrupts:
2127
description: |

Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ examples:
124124
#size-cells = <0>;
125125
#io-channel-cells = <1>;
126126
127-
/* Other propreties are omitted */
128-
adc-chan@4c {
127+
/* Other properties are omitted */
128+
channel@4c {
129129
reg = <ADC5_XO_THERM_100K_PU>;
130130
};
131131
};

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@ examples:
178178
#io-channel-cells = <1>;
179179
180180
/* Other properties are omitted */
181-
conn-therm@4f {
181+
channel@4f {
182182
reg = <ADC5_AMUX_THM3_100K_PU>;
183183
qcom,ratiometric;
184184
qcom,hw-settle-time = <200>;
185+
label = "conn_therm";
185186
};
186187
};
187188
@@ -217,16 +218,18 @@ examples:
217218
#io-channel-cells = <1>;
218219
219220
/* Other properties are omitted */
220-
xo-therm@44 {
221+
channel@44 {
221222
reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
222223
qcom,ratiometric;
223224
qcom,hw-settle-time = <200>;
225+
label = "xo_therm";
224226
};
225227
226-
conn-therm@147 {
228+
channel@147 {
227229
reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
228230
qcom,ratiometric;
229231
qcom,hw-settle-time = <200>;
232+
label = "conn_therm";
230233
};
231234
};
232235

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ examples:
326326
- |
327327
#include <dt-bindings/interrupt-controller/arm-gic.h>
328328
// Example 1 (new calbiration data: for pre v1 IP):
329-
thermal-sensor@900000 {
329+
thermal-sensor@4a9000 {
330330
compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
331331
reg = <0x4a9000 0x1000>, /* TM */
332332
<0x4a8000 0x1000>; /* SROT */
@@ -356,7 +356,7 @@ examples:
356356
- |
357357
#include <dt-bindings/interrupt-controller/arm-gic.h>
358358
// Example 1 (legacy: for pre v1 IP):
359-
tsens1: thermal-sensor@900000 {
359+
tsens1: thermal-sensor@4a9000 {
360360
compatible = "qcom,msm8916-tsens", "qcom,tsens-v0_1";
361361
reg = <0x4a9000 0x1000>, /* TM */
362362
<0x4a8000 0x1000>; /* SROT */

drivers/acpi/thermal.c

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,32 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
786786
.critical = acpi_thermal_zone_device_critical,
787787
};
788788

789+
static int acpi_thermal_zone_sysfs_add(struct acpi_thermal *tz)
790+
{
791+
struct device *tzdev = thermal_zone_device(tz->thermal_zone);
792+
int ret;
793+
794+
ret = sysfs_create_link(&tz->device->dev.kobj,
795+
&tzdev->kobj, "thermal_zone");
796+
if (ret)
797+
return ret;
798+
799+
ret = sysfs_create_link(&tzdev->kobj,
800+
&tz->device->dev.kobj, "device");
801+
if (ret)
802+
sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
803+
804+
return ret;
805+
}
806+
807+
static void acpi_thermal_zone_sysfs_remove(struct acpi_thermal *tz)
808+
{
809+
struct device *tzdev = thermal_zone_device(tz->thermal_zone);
810+
811+
sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
812+
sysfs_remove_link(&tzdev->kobj, "device");
813+
}
814+
789815
static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
790816
{
791817
int trips = 0;
@@ -819,21 +845,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
819845
if (IS_ERR(tz->thermal_zone))
820846
return -ENODEV;
821847

822-
result = sysfs_create_link(&tz->device->dev.kobj,
823-
&tz->thermal_zone->device.kobj, "thermal_zone");
848+
result = acpi_thermal_zone_sysfs_add(tz);
824849
if (result)
825850
goto unregister_tzd;
826851

827-
result = sysfs_create_link(&tz->thermal_zone->device.kobj,
828-
&tz->device->dev.kobj, "device");
829-
if (result)
830-
goto remove_tz_link;
831-
832852
status = acpi_bus_attach_private_data(tz->device->handle,
833853
tz->thermal_zone);
834854
if (ACPI_FAILURE(status)) {
835855
result = -ENODEV;
836-
goto remove_dev_link;
856+
goto remove_links;
837857
}
838858

839859
result = thermal_zone_device_enable(tz->thermal_zone);
@@ -847,10 +867,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
847867

848868
acpi_bus_detach:
849869
acpi_bus_detach_private_data(tz->device->handle);
850-
remove_dev_link:
851-
sysfs_remove_link(&tz->thermal_zone->device.kobj, "device");
852-
remove_tz_link:
853-
sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
870+
remove_links:
871+
acpi_thermal_zone_sysfs_remove(tz);
854872
unregister_tzd:
855873
thermal_zone_device_unregister(tz->thermal_zone);
856874

@@ -859,8 +877,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
859877

860878
static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
861879
{
862-
sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
863-
sysfs_remove_link(&tz->thermal_zone->device.kobj, "device");
880+
acpi_thermal_zone_sysfs_remove(tz);
864881
thermal_zone_device_unregister(tz->thermal_zone);
865882
tz->thermal_zone = NULL;
866883
acpi_bus_detach_private_data(tz->device->handle);

drivers/thermal/cpuidle_cooling.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@ static int __cpuidle_cooling_register(struct device_node *np,
237237
*
238238
* This function is in charge of creating a cooling device per cpuidle
239239
* driver and register it to the thermal framework.
240-
*
241-
* Return: zero on success, or negative value corresponding to the
242-
* error detected in the underlying subsystems.
243240
*/
244241
void cpuidle_cooling_register(struct cpuidle_driver *drv)
245242
{

drivers/thermal/gov_step_wise.c

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,11 @@
2121
* a. if the trend is THERMAL_TREND_RAISING, use higher cooling
2222
* state for this trip point
2323
* b. if the trend is THERMAL_TREND_DROPPING, do nothing
24-
* c. if the trend is THERMAL_TREND_RAISE_FULL, use upper limit
25-
* for this trip point
26-
* d. if the trend is THERMAL_TREND_DROP_FULL, use lower limit
27-
* for this trip point
2824
* If the temperature is lower than a trip point,
2925
* a. if the trend is THERMAL_TREND_RAISING, do nothing
3026
* b. if the trend is THERMAL_TREND_DROPPING, use lower cooling
3127
* state for this trip point, if the cooling state already
3228
* equals lower limit, deactivate the thermal instance
33-
* c. if the trend is THERMAL_TREND_RAISE_FULL, do nothing
34-
* d. if the trend is THERMAL_TREND_DROP_FULL, use lower limit,
35-
* if the cooling state already equals lower limit,
36-
* deactivate the thermal instance
3729
*/
3830
static unsigned long get_target_state(struct thermal_instance *instance,
3931
enum thermal_trend trend, bool throttle)
@@ -61,24 +53,16 @@ static unsigned long get_target_state(struct thermal_instance *instance,
6153
return next_target;
6254
}
6355

64-
switch (trend) {
65-
case THERMAL_TREND_RAISING:
66-
if (throttle) {
56+
if (throttle) {
57+
if (trend == THERMAL_TREND_RAISING)
6758
next_target = clamp((cur_state + 1), instance->lower, instance->upper);
68-
}
69-
break;
70-
case THERMAL_TREND_DROPPING:
71-
if (cur_state <= instance->lower) {
72-
if (!throttle)
59+
} else {
60+
if (trend == THERMAL_TREND_DROPPING) {
61+
if (cur_state <= instance->lower)
7362
next_target = THERMAL_NO_TARGET;
74-
} else {
75-
if (!throttle) {
63+
else
7664
next_target = clamp((cur_state - 1), instance->lower, instance->upper);
77-
}
7865
}
79-
break;
80-
default:
81-
break;
8266
}
8367

8468
return next_target;

drivers/thermal/intel/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,6 @@ config INTEL_TCC_COOLING
103103
on how fast the setting takes effect, and how much the CPU frequency
104104
is reduced.
105105

106-
config INTEL_MENLOW
107-
tristate "Thermal Management driver for Intel menlow platform"
108-
depends on ACPI_THERMAL
109-
help
110-
ACPI thermal management enhancement driver on
111-
Intel Menlow platform.
112-
113-
If unsure, say N.
114-
115106
config INTEL_HFI_THERMAL
116107
bool "Intel Hardware Feedback Interface"
117108
depends on NET

drivers/thermal/intel/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ obj-$(CONFIG_INTEL_BXT_PMIC_THERMAL) += intel_bxt_pmic_thermal.o
1313
obj-$(CONFIG_INTEL_PCH_THERMAL) += intel_pch_thermal.o
1414
obj-$(CONFIG_INTEL_TCC_COOLING) += intel_tcc_cooling.o
1515
obj-$(CONFIG_X86_THERMAL_VECTOR) += therm_throt.o
16-
obj-$(CONFIG_INTEL_MENLOW) += intel_menlow.o
1716
obj-$(CONFIG_INTEL_HFI_THERMAL) += intel_hfi.o

0 commit comments

Comments
 (0)