Skip to content

Commit 9fc13bb

Browse files
committed
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management fixes from Zhang Rui: - Fix a wrong __percpu structure declaration in intel_powerclamp driver (Luc Van Oostenryck) - Fix truncated name of the idle injection kthreads created by intel_powerclamp driver (Zhang Rui) - Fix the missing UUID supports in int3400 thermal driver (Matthew Garrett) - Fix a crash when accessing the debugfs of bcm2835 SoC thermal driver (Phil Elwell) - A couple of trivial fixes/cleanups in some SoC thermal drivers * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: thermal/intel_powerclamp: fix truncated kthread name thermal: mtk: Allocate enough space for mtk_thermal. thermal/int340x_thermal: fix mode setting thermal/int340x_thermal: Add additional UUIDs thermal: cpu_cooling: Remove unused cur_freq variable thermal: bcm2835: Fix crash in bcm2835_thermal_debugfs thermal: samsung: Fix incorrect check after code merge thermal/intel_powerclamp: fix __percpu declaration of worker_data
2 parents 38104c0 + 2d7c4e1 commit 9fc13bb

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed

drivers/thermal/broadcom/bcm2835_thermal.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ static const struct debugfs_reg32 bcm2835_thermal_regs[] = {
119119

120120
static void bcm2835_thermal_debugfs(struct platform_device *pdev)
121121
{
122-
struct thermal_zone_device *tz = platform_get_drvdata(pdev);
123-
struct bcm2835_thermal_data *data = tz->devdata;
122+
struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
124123
struct debugfs_regset32 *regset;
125124

126125
data->debugfsdir = debugfs_create_dir("bcm2835_thermal", NULL);
@@ -266,7 +265,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
266265

267266
data->tz = tz;
268267

269-
platform_set_drvdata(pdev, tz);
268+
platform_set_drvdata(pdev, data);
270269

271270
/*
272271
* Thermal_zone doesn't enable hwmon as default,
@@ -290,8 +289,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
290289

291290
static int bcm2835_thermal_remove(struct platform_device *pdev)
292291
{
293-
struct thermal_zone_device *tz = platform_get_drvdata(pdev);
294-
struct bcm2835_thermal_data *data = tz->devdata;
292+
struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
293+
struct thermal_zone_device *tz = data->tz;
295294

296295
debugfs_remove_recursive(data->debugfsdir);
297296
thermal_zone_of_sensor_unregister(&pdev->dev, tz);

drivers/thermal/cpu_cooling.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,11 @@ static int cpufreq_power2state(struct thermal_cooling_device *cdev,
536536
struct thermal_zone_device *tz, u32 power,
537537
unsigned long *state)
538538
{
539-
unsigned int cur_freq, target_freq;
539+
unsigned int target_freq;
540540
u32 last_load, normalised_power;
541541
struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata;
542542
struct cpufreq_policy *policy = cpufreq_cdev->policy;
543543

544-
cur_freq = cpufreq_quick_get(policy->cpu);
545544
power = power > 0 ? power : 0;
546545
last_load = cpufreq_cdev->last_load ?: 1;
547546
normalised_power = (power * 100) / last_load;

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,27 @@ enum int3400_thermal_uuid {
2222
INT3400_THERMAL_PASSIVE_1,
2323
INT3400_THERMAL_ACTIVE,
2424
INT3400_THERMAL_CRITICAL,
25+
INT3400_THERMAL_ADAPTIVE_PERFORMANCE,
26+
INT3400_THERMAL_EMERGENCY_CALL_MODE,
27+
INT3400_THERMAL_PASSIVE_2,
28+
INT3400_THERMAL_POWER_BOSS,
29+
INT3400_THERMAL_VIRTUAL_SENSOR,
30+
INT3400_THERMAL_COOLING_MODE,
31+
INT3400_THERMAL_HARDWARE_DUTY_CYCLING,
2532
INT3400_THERMAL_MAXIMUM_UUID,
2633
};
2734

2835
static char *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = {
2936
"42A441D6-AE6A-462b-A84B-4A8CE79027D3",
3037
"3A95C389-E4B8-4629-A526-C52C88626BAE",
3138
"97C68AE7-15FA-499c-B8C9-5DA81D606E0A",
39+
"63BE270F-1C11-48FD-A6F7-3AF253FF3E2D",
40+
"5349962F-71E6-431D-9AE8-0A635B710AEE",
41+
"9E04115A-AE87-4D1C-9500-0F3E340BFE75",
42+
"F5A35014-C209-46A4-993A-EB56DE7530A1",
43+
"6ED722A7-9240-48A5-B479-31EEF723D7CF",
44+
"16CAF1B7-DD38-40ED-B1C1-1B8A1913D531",
45+
"BE84BABF-C4D4-403D-B495-3128FD44dAC1",
3246
};
3347

3448
struct int3400_thermal_priv {
@@ -299,10 +313,9 @@ static int int3400_thermal_probe(struct platform_device *pdev)
299313

300314
platform_set_drvdata(pdev, priv);
301315

302-
if (priv->uuid_bitmap & 1 << INT3400_THERMAL_PASSIVE_1) {
303-
int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
304-
int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
305-
}
316+
int3400_thermal_ops.get_mode = int3400_thermal_get_mode;
317+
int3400_thermal_ops.set_mode = int3400_thermal_set_mode;
318+
306319
priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0,
307320
priv, &int3400_thermal_ops,
308321
&int3400_thermal_params, 0, 0);

drivers/thermal/intel/intel_powerclamp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct powerclamp_worker_data {
101101
bool clamping;
102102
};
103103

104-
static struct powerclamp_worker_data * __percpu worker_data;
104+
static struct powerclamp_worker_data __percpu *worker_data;
105105
static struct thermal_cooling_device *cooling_dev;
106106
static unsigned long *cpu_clamping_mask; /* bit map for tracking per cpu
107107
* clamping kthread worker
@@ -494,7 +494,7 @@ static void start_power_clamp_worker(unsigned long cpu)
494494
struct powerclamp_worker_data *w_data = per_cpu_ptr(worker_data, cpu);
495495
struct kthread_worker *worker;
496496

497-
worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inject/%ld", cpu);
497+
worker = kthread_create_worker_on_cpu(cpu, 0, "kidle_inj/%ld", cpu);
498498
if (IS_ERR(worker))
499499
return;
500500

drivers/thermal/mtk_thermal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ enum {
199199
#define MT7622_TS1 0
200200
#define MT7622_NUM_CONTROLLER 1
201201

202+
/* The maximum number of banks */
203+
#define MAX_NUM_ZONES 8
204+
202205
/* The calibration coefficient of sensor */
203206
#define MT7622_CALIBRATION 165
204207

@@ -249,7 +252,7 @@ struct mtk_thermal_data {
249252
const int num_controller;
250253
const int *controller_offset;
251254
bool need_switch_bank;
252-
struct thermal_bank_cfg bank_data[];
255+
struct thermal_bank_cfg bank_data[MAX_NUM_ZONES];
253256
};
254257

255258
struct mtk_thermal {
@@ -268,7 +271,7 @@ struct mtk_thermal {
268271
s32 vts[MAX_NUM_VTS];
269272

270273
const struct mtk_thermal_data *conf;
271-
struct mtk_thermal_bank banks[];
274+
struct mtk_thermal_bank banks[MAX_NUM_ZONES];
272275
};
273276

274277
/* MT8183 thermal sensor data */

drivers/thermal/samsung/exynos_tmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ static int exynos_get_temp(void *p, int *temp)
666666
struct exynos_tmu_data *data = p;
667667
int value, ret = 0;
668668

669-
if (!data || !data->tmu_read || !data->enabled)
669+
if (!data || !data->tmu_read)
670670
return -EINVAL;
671671
else if (!data->enabled)
672672
/*

0 commit comments

Comments
 (0)