diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-24 16:03:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-24 16:03:51 -0400 |
commit | d972604f6f87478212f012af5560c4fd4bb2b01d (patch) | |
tree | 47f043843ccbf0ee609aeb13267a76ed9c26f9fd | |
parent | 57bb8e37d71eac45b6ea9180698a9cc3db945e26 (diff) | |
parent | d7a4303b8d1fa6f60b73ed91317a51764a2a412c (diff) |
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
-rw-r--r-- | Documentation/devicetree/bindings/thermal/thermal.txt | 11 | ||||
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | drivers/thermal/Kconfig | 2 | ||||
-rw-r--r-- | drivers/thermal/intel_soc_dts_thermal.c | 26 |
4 files changed, 28 insertions, 12 deletions
diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index cc553f0952c5..eb7ee91556a5 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt | |||
@@ -97,8 +97,8 @@ get assigned to trip points of the zone. The cooling devices are expected | |||
97 | to be loaded in the target system. | 97 | to be loaded in the target system. |
98 | 98 | ||
99 | Required properties: | 99 | Required properties: |
100 | - cooling-device: A phandle of a cooling device with its specifier, | 100 | - cooling-device: A list of phandles of cooling devices with their specifiers, |
101 | Type: phandle + referring to which cooling device is used in this | 101 | Type: phandle + referring to which cooling devices are used in this |
102 | cooling specifier binding. In the cooling specifier, the first cell | 102 | cooling specifier binding. In the cooling specifier, the first cell |
103 | is the minimum cooling state and the second cell | 103 | is the minimum cooling state and the second cell |
104 | is the maximum cooling state used in this map. | 104 | is the maximum cooling state used in this map. |
@@ -276,12 +276,7 @@ thermal-zones { | |||
276 | }; | 276 | }; |
277 | map1 { | 277 | map1 { |
278 | trip = <&cpu_alert1>; | 278 | trip = <&cpu_alert1>; |
279 | cooling-device = <&fan0 5 THERMAL_NO_LIMIT>; | 279 | cooling-device = <&fan0 5 THERMAL_NO_LIMIT>, <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; |
280 | }; | ||
281 | map2 { | ||
282 | trip = <&cpu_alert1>; | ||
283 | cooling-device = | ||
284 | <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; | ||
285 | }; | 280 | }; |
286 | }; | 281 | }; |
287 | }; | 282 | }; |
diff --git a/MAINTAINERS b/MAINTAINERS index eb27d7ebfa68..b2fcd1c6bdcb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -14410,6 +14410,7 @@ F: drivers/media/radio/radio-raremono.c | |||
14410 | THERMAL | 14410 | THERMAL |
14411 | M: Zhang Rui <rui.zhang@intel.com> | 14411 | M: Zhang Rui <rui.zhang@intel.com> |
14412 | M: Eduardo Valentin <edubezval@gmail.com> | 14412 | M: Eduardo Valentin <edubezval@gmail.com> |
14413 | R: Daniel Lezcano <daniel.lezcano@linaro.org> | ||
14413 | L: linux-pm@vger.kernel.org | 14414 | L: linux-pm@vger.kernel.org |
14414 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git | 14415 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git |
14415 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git | 14416 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git |
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 82979880f985..0e69edc77d18 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig | |||
@@ -360,7 +360,7 @@ config INTEL_SOC_DTS_IOSF_CORE | |||
360 | 360 | ||
361 | config INTEL_SOC_DTS_THERMAL | 361 | config INTEL_SOC_DTS_THERMAL |
362 | tristate "Intel SoCs DTS thermal driver" | 362 | tristate "Intel SoCs DTS thermal driver" |
363 | depends on X86 && PCI | 363 | depends on X86 && PCI && ACPI |
364 | select INTEL_SOC_DTS_IOSF_CORE | 364 | select INTEL_SOC_DTS_IOSF_CORE |
365 | select THERMAL_WRITABLE_TRIPS | 365 | select THERMAL_WRITABLE_TRIPS |
366 | help | 366 | help |
diff --git a/drivers/thermal/intel_soc_dts_thermal.c b/drivers/thermal/intel_soc_dts_thermal.c index c27868b2c6af..1e47511a6bd5 100644 --- a/drivers/thermal/intel_soc_dts_thermal.c +++ b/drivers/thermal/intel_soc_dts_thermal.c | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
17 | 17 | ||
18 | #include <linux/acpi.h> | ||
18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
20 | #include <asm/cpu_device_id.h> | 21 | #include <asm/cpu_device_id.h> |
@@ -31,6 +32,7 @@ MODULE_PARM_DESC(crit_offset, | |||
31 | /* IRQ 86 is a fixed APIC interrupt for BYT DTS Aux threshold notifications */ | 32 | /* IRQ 86 is a fixed APIC interrupt for BYT DTS Aux threshold notifications */ |
32 | #define BYT_SOC_DTS_APIC_IRQ 86 | 33 | #define BYT_SOC_DTS_APIC_IRQ 86 |
33 | 34 | ||
35 | static int soc_dts_thres_gsi; | ||
34 | static int soc_dts_thres_irq; | 36 | static int soc_dts_thres_irq; |
35 | static struct intel_soc_dts_sensors *soc_dts; | 37 | static struct intel_soc_dts_sensors *soc_dts; |
36 | 38 | ||
@@ -65,7 +67,21 @@ static int __init intel_soc_thermal_init(void) | |||
65 | return err; | 67 | return err; |
66 | } | 68 | } |
67 | 69 | ||
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 | } | ||
69 | 85 | ||
70 | if (soc_dts_thres_irq) { | 86 | if (soc_dts_thres_irq) { |
71 | err = request_threaded_irq(soc_dts_thres_irq, NULL, | 87 | err = request_threaded_irq(soc_dts_thres_irq, NULL, |
@@ -90,8 +106,10 @@ static int __init intel_soc_thermal_init(void) | |||
90 | return 0; | 106 | return 0; |
91 | 107 | ||
92 | error_trips: | 108 | error_trips: |
93 | if (soc_dts_thres_irq) | 109 | if (soc_dts_thres_irq) { |
94 | free_irq(soc_dts_thres_irq, soc_dts); | 110 | free_irq(soc_dts_thres_irq, soc_dts); |
111 | acpi_unregister_gsi(soc_dts_thres_gsi); | ||
112 | } | ||
95 | intel_soc_dts_iosf_exit(soc_dts); | 113 | intel_soc_dts_iosf_exit(soc_dts); |
96 | 114 | ||
97 | return err; | 115 | return err; |
@@ -99,8 +117,10 @@ error_trips: | |||
99 | 117 | ||
100 | static void __exit intel_soc_thermal_exit(void) | 118 | static void __exit intel_soc_thermal_exit(void) |
101 | { | 119 | { |
102 | if (soc_dts_thres_irq) | 120 | if (soc_dts_thres_irq) { |
103 | free_irq(soc_dts_thres_irq, soc_dts); | 121 | free_irq(soc_dts_thres_irq, soc_dts); |
122 | acpi_unregister_gsi(soc_dts_thres_gsi); | ||
123 | } | ||
104 | intel_soc_dts_iosf_exit(soc_dts); | 124 | intel_soc_dts_iosf_exit(soc_dts); |
105 | } | 125 | } |
106 | 126 | ||