arm64: dts: qcom: sm8650: Throttle the GPU when overheating
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Fri, 10 May 2024 12:58:41 +0000 (14:58 +0200)
committerBjorn Andersson <andersson@kernel.org>
Fri, 7 Jun 2024 23:03:52 +0000 (18:03 -0500)
Add an 85C passive trip point to ensure the thermal framework takes
sufficient action to prevent reaching junction temperature and a
110C critical point to help avoid hw damage.

Also, register the GPU as a cooling device and hook it up to the
right thermal zones.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240510-topic-gpus_are_cool_now-v1-12-ababc269a438@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/sm8650.dtsi

index 9841d5cba4e0b96ed180c054bf94b69da2bd5540..5b8b1d581a137e86de04b7fce95470305f5c6d4b 100644 (file)
                        operating-points-v2 = <&gpu_opp_table>;
 
                        qcom,gmu = <&gmu>;
+                       #cooling-cells = <2>;
 
                        status = "disabled";
 
 
                        thermal-sensors = <&tsens2 1>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu0_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu0_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss0-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };
 
                        thermal-sensors = <&tsens2 2>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu1_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu1_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss1-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };
 
                        thermal-sensors = <&tsens2 3>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu2_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu2_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss2-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };
 
                        thermal-sensors = <&tsens2 4>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu3_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu3_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss3-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };
 
                        thermal-sensors = <&tsens2 5>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu4_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu4_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss4-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };
 
                        thermal-sensors = <&tsens2 6>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu5_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu5_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss5-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };
 
                        thermal-sensors = <&tsens2 7>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu6_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu6_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss6-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };
 
                        thermal-sensors = <&tsens2 8>;
 
+                       cooling-maps {
+                               map0 {
+                                       trip = <&gpu7_alert0>;
+                                       cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
                        trips {
-                               trip-point0 {
+                               gpu7_alert0: trip-point0 {
+                                       temperature = <85000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               trip-point1 {
                                        temperature = <90000>;
-                                       hysteresis = <2000>;
+                                       hysteresis = <1000>;
                                        type = "hot";
                                };
 
-                               gpuss7-critical {
+                               trip-point2 {
                                        temperature = <110000>;
-                                       hysteresis = <0>;
+                                       hysteresis = <1000>;
                                        type = "critical";
                                };
                        };