Skip to content

Commit d972604

Browse files
committed
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui: - Add Daniel Lezcano as the reviewer of thermal framework and SoC driver changes (Daniel Lezcano). - Fix a bug in intel_dts_soc_thermal driver, which does not translate IO-APIC GSI (Global System Interrupt) into Linux irq number (Hans de Goede). - For device tree bindings, allow cooling devices sharing same trip point with same contribution value to share cooling map (Viresh Kumar). * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: dt-bindings: thermal: Allow multiple devices to share cooling map MAINTAINERS: Add Daniel Lezcano as designated reviewer for thermal Thermal: Intel SoC DTS: Translate IO-APIC GSI number to linux irq number
2 parents 57bb8e3 + d7a4303 commit d972604

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

Documentation/devicetree/bindings/thermal/thermal.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ get assigned to trip points of the zone. The cooling devices are expected
9797
to be loaded in the target system.
9898

9999
Required properties:
100-
- cooling-device: A phandle of a cooling device with its specifier,
101-
Type: phandle + referring to which cooling device is used in this
100+
- cooling-device: A list of phandles of cooling devices with their specifiers,
101+
Type: phandle + referring to which cooling devices are used in this
102102
cooling specifier binding. In the cooling specifier, the first cell
103103
is the minimum cooling state and the second cell
104104
is the maximum cooling state used in this map.
@@ -276,12 +276,7 @@ thermal-zones {
276276
};
277277
map1 {
278278
trip = <&cpu_alert1>;
279-
cooling-device = <&fan0 5 THERMAL_NO_LIMIT>;
280-
};
281-
map2 {
282-
trip = <&cpu_alert1>;
283-
cooling-device =
284-
<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
279+
cooling-device = <&fan0 5 THERMAL_NO_LIMIT>, <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
285280
};
286281
};
287282
};

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14410,6 +14410,7 @@ F: drivers/media/radio/radio-raremono.c
1441014410
THERMAL
1441114411
M: Zhang Rui <[email protected]>
1441214412
M: Eduardo Valentin <[email protected]>
14413+
R: Daniel Lezcano <[email protected]>
1441314414
1441414415
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git
1441514416
T: git git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git

drivers/thermal/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ config INTEL_SOC_DTS_IOSF_CORE
360360

361361
config INTEL_SOC_DTS_THERMAL
362362
tristate "Intel SoCs DTS thermal driver"
363-
depends on X86 && PCI
363+
depends on X86 && PCI && ACPI
364364
select INTEL_SOC_DTS_IOSF_CORE
365365
select THERMAL_WRITABLE_TRIPS
366366
help

drivers/thermal/intel_soc_dts_thermal.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1717

18+
#include <linux/acpi.h>
1819
#include <linux/module.h>
1920
#include <linux/interrupt.h>
2021
#include <asm/cpu_device_id.h>
@@ -31,6 +32,7 @@ MODULE_PARM_DESC(crit_offset,
3132
/* IRQ 86 is a fixed APIC interrupt for BYT DTS Aux threshold notifications */
3233
#define BYT_SOC_DTS_APIC_IRQ 86
3334

35+
static int soc_dts_thres_gsi;
3436
static int soc_dts_thres_irq;
3537
static struct intel_soc_dts_sensors *soc_dts;
3638

@@ -65,7 +67,21 @@ static int __init intel_soc_thermal_init(void)
6567
return err;
6668
}
6769

68-
soc_dts_thres_irq = (int)match_cpu->driver_data;
70+
soc_dts_thres_gsi = (int)match_cpu->driver_data;
71+
if (soc_dts_thres_gsi) {
72+
/*
73+
* Note the flags here MUST match the firmware defaults, rather
74+
* then the request_irq flags, otherwise we get an EBUSY error.
75+
*/
76+
soc_dts_thres_irq = acpi_register_gsi(NULL, soc_dts_thres_gsi,
77+
ACPI_LEVEL_SENSITIVE,
78+
ACPI_ACTIVE_LOW);
79+
if (soc_dts_thres_irq < 0) {
80+
pr_warn("intel_soc_dts: Could not get IRQ for GSI %d, err %d\n",
81+
soc_dts_thres_gsi, soc_dts_thres_irq);
82+
soc_dts_thres_irq = 0;
83+
}
84+
}
6985

7086
if (soc_dts_thres_irq) {
7187
err = request_threaded_irq(soc_dts_thres_irq, NULL,
@@ -90,17 +106,21 @@ static int __init intel_soc_thermal_init(void)
90106
return 0;
91107

92108
error_trips:
93-
if (soc_dts_thres_irq)
109+
if (soc_dts_thres_irq) {
94110
free_irq(soc_dts_thres_irq, soc_dts);
111+
acpi_unregister_gsi(soc_dts_thres_gsi);
112+
}
95113
intel_soc_dts_iosf_exit(soc_dts);
96114

97115
return err;
98116
}
99117

100118
static void __exit intel_soc_thermal_exit(void)
101119
{
102-
if (soc_dts_thres_irq)
120+
if (soc_dts_thres_irq) {
103121
free_irq(soc_dts_thres_irq, soc_dts);
122+
acpi_unregister_gsi(soc_dts_thres_gsi);
123+
}
104124
intel_soc_dts_iosf_exit(soc_dts);
105125
}
106126

0 commit comments

Comments
 (0)