Skip to content

Commit b109bc7

Browse files
committed
Merge tag 'thermal-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal updates from Daniel Lezcano: - Add upper and lower limits clamps for the cooling device state in the power allocator governor (Michael Kao) - Add upper and lower limits support for the power allocator governor (Lukasz Luba) - Optimize conditions testing for the trip points (Bernard Zhao) - Replace spin_lock_irqsave by spin_lock in hard IRQ on the rcar driver (Tian Tao) - Add MT8516 dt-bindings and device reset optional support (Fabien Parent) - Add a quiescent period to cool down the PCH when entering S0iX (Sumeet Pawnikar) - Use bitmap API instead of re-inventing the wheel on sun8i (Yangtao Li) - Remove useless NULL check in the hwmon driver (Bernard Zhao) - Update the current state in the cpufreq cooling device only if the frequency change is effective (Zhuguangqing) - Improve the schema validation for the rcar DT bindings (Geert Uytterhoeven) - Fix the user time unit in the documentation (Viresh Kumar) - Add PCI ids for Lewisburg PCH (Andres Freund) - Add hwmon support on amlogic (Martin Blumenstingl) - Fix build failure for PCH entering on in S0iX (Randy Dunlap) - Improve the k_* coefficient for the power allocator governor (Lukasz Luba) - Fix missing const on a sysfs attribute (Rikard Falkeborn) - Remove broken interrupt support on rcar to be replaced by a new one (Niklas Söderlund) - Improve the error code handling at init time on imx8mm (Fabio Estevam) - Compute interval validity once instead at each temperature reading iteration on acerhdf (Daniel Lezcano) - Add r8a779a0 support (Niklas Söderlund) - Add PCI ids for AlderLake PCH and mmio refactoring (Srinivas Pandruvada) - Add RFIM and mailbox support on int340x (Srinivas Pandruvada) - Use macro for temperature calculation on PCH (Sumeet Pawnikar) - Simplify return conditions at probe time on Broadcom (Zheng Yongjun) - Fix workload name on PCH (Srinivas Pandruvada) - Migrate the devfreq cooling device code to the energy model API (Lukasz Luba) - Emit a warning if the thermal_zone_device_update is called without the .get_temp() ops (Daniel Lezcano) - Add critical and hot ops for the thermal zone (Daniel Lezcano) - Remove notification usage when critical is reached on rcar (Daniel Lezcano) - Fix devfreq build when ENERGY_MODEL is not set (Lukasz Luba) * tag 'thermal-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (45 commits) thermal/drivers/devfreq_cooling: Fix the build when !ENERGY_MODEL thermal/drivers/rcar: Remove notification usage thermal/core: Add critical and hot ops thermal/core: Emit a warning if the thermal zone is updated without ops drm/panfrost: Register devfreq cooling and attempt to add Energy Model thermal: devfreq_cooling: remove old power model and use EM thermal: devfreq_cooling: add new registration functions with Energy Model thermal: devfreq_cooling: use a copy of device status thermal: devfreq_cooling: change tracing function and arguments thermal: int340x: processor_thermal: Correct workload type name thermal: broadcom: simplify the return expression of bcm2711_thermal_probe() thermal: intel: pch: use macro for temperature calculation thermal: int340x: processor_thermal: Add mailbox driver thermal: int340x: processor_thermal: Add RFIM driver thermal: int340x: processor_thermal: Add AlderLake PCI device id thermal: int340x: processor_thermal: Refactor MMIO interface thermal: rcar_gen3_thermal: Add r8a779a0 support dt-bindings: thermal: rcar-gen3-thermal: Add r8a779a0 support platform/x86/drivers/acerhdf: Check the interval value when it is set platform/x86/drivers/acerhdf: Use module_param_cb to set/get polling interval ...
2 parents ee249d3 + 4401117 commit b109bc7

31 files changed

+1278
-799
lines changed

Documentation/devicetree/bindings/thermal/mediatek-thermal.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ Required properties:
1414
- "mediatek,mt2712-thermal" : For MT2712 family of SoCs
1515
- "mediatek,mt7622-thermal" : For MT7622 SoC
1616
- "mediatek,mt8183-thermal" : For MT8183 family of SoCs
17+
- "mediatek,mt8516-thermal", "mediatek,mt2701-thermal : For MT8516 family of SoCs
1718
- reg: Address range of the thermal controller
1819
- interrupts: IRQ for the thermal controller
1920
- clocks, clock-names: Clocks needed for the thermal controller. required
2021
clocks are:
2122
"therm": Main clock needed for register access
2223
"auxadc": The AUXADC clock
23-
- resets: Reference to the reset controller controlling the thermal controller.
2424
- mediatek,auxadc: A phandle to the AUXADC which the thermal controller uses
2525
- mediatek,apmixedsys: A phandle to the APMIXEDSYS controller.
2626
- #thermal-sensor-cells : Should be 0. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description.
2727

2828
Optional properties:
29+
- resets: Reference to the reset controller controlling the thermal controller.
2930
- nvmem-cells: A phandle to the calibration data provided by a nvmem device. If
3031
unspecified default values shall be used.
3132
- nvmem-cell-names: Should be "calibration-data"

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ properties:
2626
- renesas,r8a77961-thermal # R-Car M3-W+
2727
- renesas,r8a77965-thermal # R-Car M3-N
2828
- renesas,r8a77980-thermal # R-Car V3H
29+
- renesas,r8a779a0-thermal # R-Car V3U
30+
2931
reg:
3032
minItems: 2
31-
maxItems: 3
33+
maxItems: 4
3234
items:
3335
- description: TSC1 registers
3436
- description: TSC2 registers
3537
- description: TSC3 registers
38+
- description: TSC4 registers
3639

3740
interrupts:
3841
items:
@@ -55,12 +58,22 @@ properties:
5558
required:
5659
- compatible
5760
- reg
58-
- interrupts
5961
- clocks
6062
- power-domains
6163
- resets
6264
- "#thermal-sensor-cells"
6365

66+
if:
67+
not:
68+
properties:
69+
compatible:
70+
contains:
71+
enum:
72+
- renesas,r8a779a0-thermal
73+
then:
74+
required:
75+
- interrupts
76+
6477
additionalProperties: false
6578

6679
examples:

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

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,35 @@ properties:
6262
"#thermal-sensor-cells":
6363
const: 0
6464

65-
if:
66-
properties:
67-
compatible:
68-
contains:
69-
enum:
70-
- renesas,thermal-r8a73a4 # R-Mobile APE6
71-
- renesas,thermal-r8a7779 # R-Car H1
72-
then:
73-
required:
74-
- compatible
75-
- reg
76-
else:
77-
required:
78-
- compatible
79-
- reg
80-
- interrupts
81-
- clocks
82-
- power-domains
83-
- resets
65+
required:
66+
- compatible
67+
- reg
68+
69+
allOf:
70+
- if:
71+
not:
72+
properties:
73+
compatible:
74+
contains:
75+
enum:
76+
- renesas,thermal-r8a73a4 # R-Mobile APE6
77+
- renesas,thermal-r8a7779 # R-Car H1
78+
then:
79+
required:
80+
- resets
81+
- '#thermal-sensor-cells'
82+
83+
- if:
84+
not:
85+
properties:
86+
compatible:
87+
contains:
88+
const: renesas,thermal-r8a7779 # R-Car H1
89+
then:
90+
required:
91+
- interrupts
92+
- clocks
93+
- power-domains
8494

8595
additionalProperties: false
8696

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,7 @@ stats/time_in_state_ms:
654654
The amount of time spent by the cooling device in various cooling
655655
states. The output will have "<state> <time>" pair in each line, which
656656
will mean this cooling device spent <time> msec of time at <state>.
657-
Output will have one line for each of the supported states. usertime
658-
units here is 10mS (similar to other time exported in /proc).
657+
Output will have one line for each of the supported states.
659658
RO, Required
660659

661660

drivers/gpu/drm/panfrost/panfrost_devfreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)
138138
}
139139
pfdevfreq->devfreq = devfreq;
140140

141-
cooling = of_devfreq_cooling_register(dev->of_node, devfreq);
141+
cooling = devfreq_cooling_em_register(devfreq, NULL);
142142
if (IS_ERR(cooling))
143143
DRM_DEV_INFO(dev, "Failed to register cooling device\n");
144144
else

drivers/platform/x86/acerhdf.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ static struct platform_device *acerhdf_dev;
8484

8585
module_param(kernelmode, uint, 0);
8686
MODULE_PARM_DESC(kernelmode, "Kernel mode fan control on / off");
87-
module_param(interval, uint, 0600);
88-
MODULE_PARM_DESC(interval, "Polling interval of temperature check");
8987
module_param(fanon, uint, 0600);
9088
MODULE_PARM_DESC(fanon, "Turn the fan on above this temperature");
9189
module_param(fanoff, uint, 0600);
@@ -336,7 +334,10 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
336334
}
337335
if (verbose)
338336
pr_notice("interval changed to: %d\n", interval);
339-
thermal->polling_delay = interval*1000;
337+
338+
if (thermal)
339+
thermal->polling_delay = interval*1000;
340+
340341
prev_interval = interval;
341342
}
342343
}
@@ -351,8 +352,6 @@ static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal, int *t)
351352
{
352353
int temp, err = 0;
353354

354-
acerhdf_check_param(thermal);
355-
356355
err = acerhdf_get_temp(&temp);
357356
if (err)
358357
return err;
@@ -824,3 +823,24 @@ MODULE_ALIAS("dmi:*:*Acer*:pnExtensa*5420*:");
824823

825824
module_init(acerhdf_init);
826825
module_exit(acerhdf_exit);
826+
827+
static int interval_set_uint(const char *val, const struct kernel_param *kp)
828+
{
829+
int ret;
830+
831+
ret = param_set_uint(val, kp);
832+
if (ret)
833+
return ret;
834+
835+
acerhdf_check_param(thz_dev);
836+
837+
return 0;
838+
}
839+
840+
static const struct kernel_param_ops interval_ops = {
841+
.set = interval_set_uint,
842+
.get = param_get_uint,
843+
};
844+
845+
module_param_cb(interval, &interval_ops, &interval, 0600);
846+
MODULE_PARM_DESC(interval, "Polling interval of temperature check");

drivers/thermal/amlogic_thermal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/thermal.h>
3030

3131
#include "thermal_core.h"
32+
#include "thermal_hwmon.h"
3233

3334
#define TSENSOR_CFG_REG1 0x4
3435
#define TSENSOR_CFG_REG1_RSET_VBG BIT(12)
@@ -287,6 +288,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
287288
return ret;
288289
}
289290

291+
if (devm_thermal_add_hwmon_sysfs(pdata->tzd))
292+
dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
293+
290294
ret = amlogic_thermal_initialize(pdata);
291295
if (ret)
292296
return ret;

drivers/thermal/broadcom/bcm2711_thermal.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ static int bcm2711_thermal_probe(struct platform_device *pdev)
102102
priv->thermal = thermal;
103103

104104
thermal->tzp->no_hwmon = false;
105-
ret = thermal_add_hwmon_sysfs(thermal);
106-
if (ret)
107-
return ret;
108-
109-
return 0;
105+
return thermal_add_hwmon_sysfs(thermal);
110106
}
111107

112108
static struct platform_driver bcm2711_thermal_driver = {

drivers/thermal/cpufreq_cooling.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,11 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
438438
if (cpufreq_cdev->cpufreq_state == state)
439439
return 0;
440440

441-
cpufreq_cdev->cpufreq_state = state;
442-
443441
frequency = get_state_freq(cpufreq_cdev, state);
444442

445443
ret = freq_qos_update_request(&cpufreq_cdev->qos_req, frequency);
446-
447444
if (ret > 0) {
445+
cpufreq_cdev->cpufreq_state = state;
448446
cpus = cpufreq_cdev->policy->cpus;
449447
max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus));
450448
capacity = frequency * max_capacity;

0 commit comments

Comments
 (0)