From 76ac54aae381714cee7bf1b03d4bce097b1630de Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Thu, 4 Jul 2019 21:41:41 +0200 Subject: [PATCH] sunxi-dev Fix wrong temperature readings Signed-off-by: Igor Pecovnik --- ... ths-29-add-correct-h5-thermal-zone.patch} | 69 +++++++++---------- 1 file changed, 32 insertions(+), 37 deletions(-) rename patch/kernel/sunxi-dev/{ths-29-sun4i-gpadc-iio-add-h5-thermal-zone.patch => ths-29-add-correct-h5-thermal-zone.patch} (59%) diff --git a/patch/kernel/sunxi-dev/ths-29-sun4i-gpadc-iio-add-h5-thermal-zone.patch b/patch/kernel/sunxi-dev/ths-29-add-correct-h5-thermal-zone.patch similarity index 59% rename from patch/kernel/sunxi-dev/ths-29-sun4i-gpadc-iio-add-h5-thermal-zone.patch rename to patch/kernel/sunxi-dev/ths-29-add-correct-h5-thermal-zone.patch index a167a5e57b..0f2391df50 100644 --- a/patch/kernel/sunxi-dev/ths-29-sun4i-gpadc-iio-add-h5-thermal-zone.patch +++ b/patch/kernel/sunxi-dev/ths-29-add-correct-h5-thermal-zone.patch @@ -1,32 +1,29 @@ -diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -index 55b95569..422589b3 100644 ---- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi -@@ -41,6 +41,7 @@ - */ - - #include -+#include - - / { - cpus { -@@ -98,6 +99,80 @@ - method = "smc"; +diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +index 8da95c0df..70e55fe32 100644 +--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi ++++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +@@ -1030,28 +1030,74 @@ }; -+ thermal-zones { + thermal-zones { +- cpu_thermal: cpu-thermal { +- polling-delay-passive = <330>; + cpu-thermal { + /* milliseconds */ + polling-delay-passive = <250>; -+ polling-delay = <1000>; + polling-delay = <1000>; +- thermal-sensors = <&ths 0>; + thermal-sensors = <&ths>; -+ -+ trips { + + trips { +- cpu_hot_trip: cpu-warm { +- temperature = <65000>; + cpu_warm: cpu_warm { + temperature = <75000>; -+ hysteresis = <2000>; -+ type = "passive"; -+ }; + hysteresis = <2000>; + type = "passive"; + }; +- cpu_very_hot_trip: cpu-very-hot { + + cpu_hot_pre: cpu_hot_pre { + temperature = <80000>; @@ -41,8 +38,8 @@ index 55b95569..422589b3 100644 + }; + + cpu_very_hot_pre: cpu_very_hot_pre { -+ temperature = <90000>; -+ hysteresis = <2000>; + temperature = <90000>; + hysteresis = <2000>; + type = "passive"; + }; + @@ -55,11 +52,14 @@ index 55b95569..422589b3 100644 + cpu_crit: cpu_crit { + temperature = <105000>; + hysteresis = <2000>; -+ type = "critical"; -+ }; -+ }; -+ -+ cooling-maps { + type = "critical"; + }; + }; + + cooling-maps { +- cpu-warm-limit { +- trip = <&cpu_hot_trip>; +- cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + cpu_warm_limit_cpu { + trip = <&cpu_warm>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT 2>; @@ -76,18 +76,13 @@ index 55b95569..422589b3 100644 + }; + + cpu_very_hot_pre_limit_cpu { -+ trip = <&cpu_very_hot>; ++ trip = <&cpu_very_hot_pre>; + cooling-device = <&cpu0 5 6>; + }; + + cpu_very_hot_limit_cpu { + trip = <&cpu_very_hot>; + cooling-device = <&cpu0 7 THERMAL_NO_LIMIT>; -+ }; -+ }; -+ }; -+ }; -+ - timer { - compatible = "arm,armv8-timer"; - interrupts =