Skip to contentSkip to conversation

of: Add bindings of hw-trips for soctherm

PATCH Superseded Wei Ni 2 participants 3 messages Jan 13, 2016 – Jan 15, 2016

Subsystems (3)

v1 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Wei Ni

author
#0 lore raw

PATCH 6/10 of: Add bindings of hw-trips 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 | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +29 -0
index 6b68cd150405..77aef0b4968b 100644
@@ -26,6 +26,18 @@ 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-trips : 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:
+      - therm-temp : Shutdown temperature in millicelsius, once the
+        temperature of this sensor is higher than the therm-temp, the system
+        will be reset or shutdown.
+      - throt-temp : HW throttle temperature in millicelsius, once the
+        temperature of this sensor is higher than the throt-temp, the HW
+        throttle will be triggered in soctherm. (Not implement yet)
 
 Example :
 
@@ -40,6 +52,23 @@ Example :
 		reset-names = "soctherm";
 
 		#thermal-sensor-cells = <1>;
+
+		hw-trips {
+			cpu {
+				therm-temp = <103000>;
+				throt-temp = <98500>;
+			};
+			gpu {
+				therm-temp = <103500>;
+				throt-temp = <100000>;
+			};
+			mem {
+				therm-temp = <103500>;
+			};
+			pll {
+				therm-temp = <105000>;
+			};
+		};
 	};
 
 Example: referring to thermal sensors :
Signature · 1 line
1.9.1
#1 lore raw

Cc'ing [email protected], please make sure to always Cc that list on device tree binding patches.

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.

Perhaps you should mention Tegra in the subject and the commit message?

Also please use all of the 72 columns that are at your disposal when writing commit messages.

Quoted 10 lines
---
 .../devicetree/bindings/thermal/tegra-soctherm.txt | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +0 -0
index 6b68cd150405..77aef0b4968b 100644

Documentation/devicetree/bindings/thermal/tegra-soctherm.txt Required properties : · line 31

Quoted 6 lines
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +3 -0
@@ -26,6 +26,18 @@ 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-trips : A sub-node which is a container of hardware trip points
+    for each sensors.

Perhaps call the node "trip-points"? "hw-" seems kind of redundant since DT is a hardware description, and "trips" isn't a very good abbreviation for "trip-points".

Documentation/devicetree/bindings/thermal/tegra-soctherm.txt Required properties : · line 37

Quoted 6 lines
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +6 -0
+  * sensors: Sub-nodes which are used to describe the HW trip points info,
+        must be named as "cpu", "gpu", "mem", "pll".
+      Properties:
+      - therm-temp : Shutdown temperature in millicelsius, once the
+        temperature of this sensor is higher than the therm-temp, the system
+        will be reset or shutdown.

Why not call the property "shutdown-temperature" if that's what it is.

Documentation/devicetree/bindings/thermal/tegra-soctherm.txt Required properties : · line 40

Quoted 3 lines
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +3 -0
+      - throt-temp : HW throttle temperature in millicelsius, once the
+        temperature of this sensor is higher than the throt-temp, the HW
+        throttle will be triggered in soctherm. (Not implement yet)

"throttle-temperature" would be a better name in my opinion. More typing perhaps but less chance of getting the abbreviations wrong. Also there's no need for the "(Not implement yet)" because the binding isn't about an implementation, it's about the hardware description. If you have no code that uses this, a safer option might be to just drop it for now.

Thierry

author
#2 lore raw
Quoted 28 lines · Thierry Reding

* PGP Signed by an unknown key

Cc'ing [email protected], please make sure to always Cc that list on device tree binding patches.

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.

Perhaps you should mention Tegra in the subject and the commit message?

Also please use all of the 72 columns that are at your disposal when writing commit messages.

Quoted 13 lines
---
 .../devicetree/bindings/thermal/tegra-soctherm.txt | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +0 -0
index 6b68cd150405..77aef0b4968b 100644
@@ -26,6 +26,18 @@ Required properties :
     of this property. See <dt-bindings/thermal/tegra124-soctherm.h> for a
     list of valid values when referring to thermal sensors.
 
Quoted 7 lines

Documentation/devicetree/bindings/thermal/tegra-soctherm.txt Required properties : · line 31

Quoted 3 lines
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +3 -0
+Optional properties:
+- hw-trips : A sub-node which is a container of hardware trip points
+    for each sensors.

Perhaps call the node "trip-points"? "hw-" seems kind of redundant since DT is a hardware description, and "trips" isn't a very good abbreviation for "trip-points".

In the linux thermal framework, it has the node definition "trips" and have sysfs interface named as "trip-points", these "trip" are set for SW. If we also use the "trip-points" in here, it will make confusion.
I used "hw-", because it's different with the SW trip-points, the trip-points under it are for the Tegra to shutdown/reset from HW, or trigger the HW-throttle. (not SW throttle, see below)
How about "hw-trip-points"?

Quoted 9 lines

Documentation/devicetree/bindings/thermal/tegra-soctherm.txt Required properties : · line 37

Quoted 7 lines
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +6 -0
+  * sensors: Sub-nodes which are used to describe the HW trip points info,
+        must be named as "cpu", "gpu", "mem", "pll".
+      Properties:
+      - therm-temp : Shutdown temperature in millicelsius, once the
+        temperature of this sensor is higher than the therm-temp, the system
+        will be reset or shutdown.

Why not call the property "shutdown-temperature" if that's what it is.

This is the shutdown/reset temperature. The Tegra's SPEC calls it as thermtrip event, when the temperature touch this value, it will trigger the thermtrip event, and then will cause the system reset or shutdown, it depends on the HW platform design. So I named it as "therm-temp".
I think it's better to change to "thermtrip-temperature".

Quoted 10 lines

Documentation/devicetree/bindings/thermal/tegra-soctherm.txt Required properties : · line 40

Quoted 4 lines
Documentation/devicetree/bindings/thermal/tegra-soctherm.txt +3 -0
+      - throt-temp : HW throttle temperature in millicelsius, once the
+        temperature of this sensor is higher than the throt-temp, the HW
+        throttle will be triggered in soctherm. (Not implement yet)

"throttle-temperature" would be a better name in my opinion. More typing perhaps but less chance of getting the abbreviations wrong. Also there's no need for the "(Not implement yet)" because the binding isn't about an implementation, it's about the hardware description. If you have no code that uses this, a safer option might be to just drop it for now.

The Tegra soctherm support throttle function, when the temperature touch the trip point, the HW will skip the CPU/GPU' pulse, so I called it as HW throttle. For the SW throttle, the SW will cap the CPU/GPU or other clocks frequencies. Anyway, since we didn't support it yet, I will drop it for now.

Quoted 6 lines

Thierry

* Unknown Key
* 0x7F3EB3A1