Skip to content

Commit 57120fa

Browse files
committed
Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management fixes from Zhang Rui: - fix an ordering issue in cpu cooling that cooling device is registered before it's ready (freq_table being populated). (Lukasz Luba) - fix a missing comment update (Caesar Wang) * 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: thermal: add the note for set_trip_temp thermal: cpu_cooling: fix improper order during initialization
2 parents 8714f8f + 5a5e78c commit 57120fa

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

drivers/thermal/cpu_cooling.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -857,14 +857,6 @@ __cpufreq_cooling_register(struct device_node *np,
857857
goto free_power_table;
858858
}
859859

860-
snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
861-
cpufreq_dev->id);
862-
863-
cool_dev = thermal_of_cooling_device_register(np, dev_name, cpufreq_dev,
864-
&cpufreq_cooling_ops);
865-
if (IS_ERR(cool_dev))
866-
goto remove_idr;
867-
868860
/* Fill freq-table in descending order of frequencies */
869861
for (i = 0, freq = -1; i <= cpufreq_dev->max_level; i++) {
870862
freq = find_next_max(table, freq);
@@ -877,6 +869,14 @@ __cpufreq_cooling_register(struct device_node *np,
877869
pr_debug("%s: freq:%u KHz\n", __func__, freq);
878870
}
879871

872+
snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
873+
cpufreq_dev->id);
874+
875+
cool_dev = thermal_of_cooling_device_register(np, dev_name, cpufreq_dev,
876+
&cpufreq_cooling_ops);
877+
if (IS_ERR(cool_dev))
878+
goto remove_idr;
879+
880880
cpufreq_dev->clipped_freq = cpufreq_dev->freq_table[0];
881881
cpufreq_dev->cool_dev = cool_dev;
882882

include/linux/thermal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ struct thermal_genl_event {
335335
* @get_trend: a pointer to a function that reads the sensor temperature trend.
336336
* @set_emul_temp: a pointer to a function that sets sensor emulated
337337
* temperature.
338+
* @set_trip_temp: a pointer to a function that sets the trip temperature on
339+
* hardware.
338340
*/
339341
struct thermal_zone_of_device_ops {
340342
int (*get_temp)(void *, int *);

0 commit comments

Comments
 (0)