Skip to contentSkip to conversation

of: Add bindings of hw-trip-points for soctherm

PATCH Superseded Wei Ni 3 participants 6 messages Jan 29, 2016 – Feb 17, 2016

Subsystems (3)

v5 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Wei Ni

author
#0 lore raw

PATCH v5 7/11 of: Add bindings of hw-trip-points for soctherm

Add hw-trips sub-node for soctherm, which is
used to describe the hardware trip points for
each soctherm sensors.

---
 .../devicetree/bindings/thermal/tegra-soctherm.txt | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +24 -0
index 6b68cd150405..fb397191faa7 100644
@@ -26,6 +26,15 @@ Required properties :
     of this property. See <dt-bindings/thermal/tegra124-soctherm.h> for a
     list of valid values when referring to thermal sensors.
 
+Optional properties:
+- hw-trip-points : A sub-node which is a container of hardware trip points
+    for each sensors.
+  * sensors: Sub-nodes which are used to describe the HW trip points info,
+        must be named as "cpu", "gpu", "mem", "pll".
+      Properties:
+      - thermtrip-mC : Shutdown or reset temperature in millicelsius,
+        once the temperature of this sensor is higher than it, the system
+        will be shutdown or reset.
 
 Example :
 
@@ -40,6 +49,21 @@ Example :
 		reset-names = "soctherm";
 
 		#thermal-sensor-cells = <1>;
+
+		hw-trip-points {
+			cpu {
+				thermtrip-mC = <103000>;
+			};
+			gpu {
+				thermtrip-mC = <103500>;
+			};
+			mem {
+				thermtrip-mC = <103500>;
+			};
+			pll {
+				thermtrip-mC = <105000>;
+			};
+		};
 	};
 
 Example: referring to thermal sensors :
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 3 lines · Wei Ni

Add hw-trips sub-node for soctherm, which is
used to describe the hardware trip points for
each soctherm sensors.

I still don't understand why you are doing something custom here. What's wrong with what is defined in:

Documentation/devicetree/bindings/thermal/thermal.txt

Rob

author
#2 lore raw

Hi, Rob

Quoted 9 lines · Rob Herring
Quoted 3 lines · Wei Ni

Add hw-trips sub-node for soctherm, which is
used to describe the hardware trip points for
each soctherm sensors.

I still don't understand why you are doing something custom here. What's wrong with what is defined in:

Documentation/devicetree/bindings/thermal/thermal.txt

In current thermal framework, it support to set trip points for the thermal zones, but this trip point is handled by SW, doesn't have callbacks to program the hardware.
There had patches:
[PATCH 12/16] thermal: thermal: Add support for hardware-tracked trip points,
http://lists.infradead.org/pipermail/linux-mediatek/2015-May/000866.html,
which can support to program hardware to set trip points, but it seems this series didn't be taken.
So I add this hw-trip-points sub-node for soctherm.

Hi, Sascha Hauer

Thanks.
Wei.

Quoted 3 lines

Rob

author
#3 lore raw
Quoted 23 lines · Wei Ni

Hi, Rob

Quoted 9 lines · Rob Herring
Quoted 3 lines · Wei Ni

Add hw-trips sub-node for soctherm, which is
used to describe the hardware trip points for
each soctherm sensors.

I still don't understand why you are doing something custom here. What's wrong with what is defined in:

Documentation/devicetree/bindings/thermal/thermal.txt

In current thermal framework, it support to set trip points for the thermal zones, but this trip point is handled by SW, doesn't have callbacks to program the hardware.
There had patches:
[PATCH 12/16] thermal: thermal: Add support for hardware-tracked trip points,
http://lists.infradead.org/pipermail/linux-mediatek/2015-May/000866.html,
which can support to program hardware to set trip points, but it seems this series didn't be taken.
So I add this hw-trip-points sub-node for soctherm.

Quoted 1 line

Hi, Sascha Hauer

Hi, Sasha
Sorry, I forgot to type messages in previous mail.

I noticed that you submitted "[PATCH 12/16] thermal: thermal: Add support for hardware-tracked trip points" long time ago, I think it's very useful, do you know why it didn't be taken?

Quoted 7 lines

Thanks.
Wei.

Quoted 3 lines

Rob

author
#4 lore raw
In reply to Wei Ni

Hi, Rob

Quoted 12 lines · Wei Ni

Hi, Rob

Quoted 9 lines · Rob Herring
Quoted 3 lines · Wei Ni

Add hw-trips sub-node for soctherm, which is
used to describe the hardware trip points for
each soctherm sensors.

I still don't understand why you are doing something custom here. What's wrong with what is defined in:

Documentation/devicetree/bindings/thermal/thermal.txt

I think it's better to add a .set_trip_temp for of-thermal's thermal_zone_of_device_ops{}, so that we can set trip points on hardware. I'm preparing patches, and will send out next version.
Thanks for your comments.

Quoted 19 lines

In current thermal framework, it support to set trip points for the thermal zones, but this trip point is handled by SW, doesn't have callbacks to program the hardware.
There had patches:
[PATCH 12/16] thermal: thermal: Add support for hardware-tracked trip points,
http://lists.infradead.org/pipermail/linux-mediatek/2015-May/000866.html,
which can support to program hardware to set trip points, but it seems this series didn't be taken.
So I add this hw-trip-points sub-node for soctherm.

Hi, Sascha Hauer

Thanks.
Wei.

Quoted 3 lines

Rob

#5 lore raw

(cc += linux-pm)

Rob,

The Linux thermal framework makes a sharp distinction between "thermal zones" and "cooling devices". thermal_zones are aware of temperatures and have trip points. cooling_devices are unaware of temperatures -- they just have a state variable. The thermal framework binds thermal zones at particular temperatures to particular cooling devices. It does so *in software*

The SOC_THERM IP block doesn't fit neatly in that paradigm. Yes, it provides the ability to read temperatures and raise interrupts at temperatures. However, it also has the ability to take cooling action _in hardware_ at particular temperatures. It can throttle the CPU & GPU clock and it can shut down the SOC. Neither of those are graceful actions, but they are valuable in practice.

In previous incarnations of this driver we have implemented an unholy mash-up of a cooling device and a thermal zone for configuring the hardware thermal actions. It was a mess. This patchset from Wei takes a simpler approach -- allow the thermal hardware cooling actions to be configured directly via DT. It's simple but it's good enough in practice. I like it.

-Matt

Quoted 18 lines · Wei Ni
Quoted 4 lines · Wei Ni
Quoted 4 lines

Hi, Rob

Quoted 1 line · Rob Herring
Quoted 1 line · Wei Ni
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

Add hw-trips sub-node for soctherm, which is
used to describe the hardware trip points for
each soctherm sensors.

I still don't understand why you are doing something custom here. What's wrong with what is defined in:

Documentation/devicetree/bindings/thermal/thermal.txt

I think it's better to add a .set_trip_temp for of-thermal's thermal_zone_of_device_ops{}, so that we can set trip points on hardware. I'm preparing patches, and will send out next version.
Thanks for your comments.