From 10996880538c4cff0665d612399ac575933d5e6c Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Tue, 7 Jan 2025 16:47:25 +0000 Subject: [PATCH] thermal: Low power shutdown policy bringup Bug: 363336093 Bug: 361454856 Bug: 363070211 Test: emul_temp battery and VIRTUAL-SKIN for idle, camera use cases and check thermal log. Flag: EXEMPT config change Change-Id: I81f19bb87a51879ddffebec3df45452f0b681891 --- device-comet.mk | 1 + powerhint-comet.json | 32 +++++++++ thermal/thermal_info_config_comet.json | 5 ++ thermal/thermal_info_config_lpm_comet.json | 81 ++++++++++++++++++++++ 4 files changed, 119 insertions(+) create mode 100644 thermal/thermal_info_config_lpm_comet.json diff --git a/device-comet.mk b/device-comet.mk index 0ebd00c..e1a4e83 100644 --- a/device-comet.mk +++ b/device-comet.mk @@ -197,6 +197,7 @@ PRODUCT_COPY_FILES += \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_backup_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_backup.json \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_comet.tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_speaker_estimation_model_comet.tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_speaker_estimation_model.tflite \ + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_lpm_comet.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_lpm.json \ ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_COPY_FILES += \ diff --git a/powerhint-comet.json b/powerhint-comet.json index df04723..770a9e5 100644 --- a/powerhint-comet.json +++ b/powerhint-comet.json @@ -888,6 +888,26 @@ "ResetOnInit": true, "Type": "Property" }, + { + "Name": "ntc_critical_trip", + "Path": "/dev/thermal/tz-by-name/charger_therm/trip_point_1_temp", + "Values": [ + "64000", + "72000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "ntc_hot_trip", + "Path": "/dev/thermal/tz-by-name/charger_therm/trip_point_2_temp", + "Values": [ + "66000", + "74000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, { "Name": "MIFTargetLoad", "Path": "/sys/class/devfreq/17000010.devfreq_mif/interactive/target_load", @@ -3388,6 +3408,18 @@ "Duration": 0, "Value": "1" }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_critical_trip", + "Duration": 0, + "Value": "72000" + }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_hot_trip", + "Duration": 0, + "Value": "74000" + }, { "PowerHint": "GAME", "Node": "PMU_POLL", diff --git a/thermal/thermal_info_config_comet.json b/thermal/thermal_info_config_comet.json index e08dccd..20ae223 100644 --- a/thermal/thermal_info_config_comet.json +++ b/thermal/thermal_info_config_comet.json @@ -4,6 +4,11 @@ "Name": "battery", "Type": "BATTERY", "HotThreshold": ["NAN", "NAN", "NAN", "NAN", "NAN", "NAN", "60.0"], + "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.9], + "SendCallback": true, + "TripPointIgnorable": true, + "PollingDelay": 60000, + "PassiveDelay": 60000, "Multiplier": 0.001 }, { diff --git a/thermal/thermal_info_config_lpm_comet.json b/thermal/thermal_info_config_lpm_comet.json new file mode 100644 index 0000000..e60fdfa --- /dev/null +++ b/thermal/thermal_info_config_lpm_comet.json @@ -0,0 +1,81 @@ +{ + "Include": ["thermal_info_config.json"], + "Sensors":[ + { + "Name":"SkinShutdownModeHighPower", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"COUNT_THRESHOLD", + "Combination":["VIRTUAL-SKIN", "PARTIAL_SYSTEM_POWER"], + "CombinationType":["SENSOR", "ODPM"], + "Coefficient":[57000.0, 1000.0], + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", "NAN", 2.0], + "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9], + "Multiplier":1 + }, + { + "Name":"BatteryShutdownModeHighPower", + "Type":"UNKNOWN", + "VirtualSensor":true, + "Formula":"COUNT_THRESHOLD", + "Combination":["battery", "PARTIAL_SYSTEM_POWER"], + "CombinationType":["SENSOR", "ODPM"], + "Coefficient":[60000.0, 1000.0], + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", "NAN", 2.0], + "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.9], + "Multiplier":1 + }, + { + "Name":"battery", + "Type":"BATTERY", + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", 60.0, 65.0], + "HotHysteresis":[0.0, 0.0, 0.0, 0.0, 0.0, 5.0, 1.9], + "SeverityReference": "BatteryShutdownModeHighPower", + "SendCallback": true, + "TripPointIgnorable": true, + "PollingDelay": 60000, + "PassiveDelay": 60000, + "Multiplier":0.001 + }, + { + "Name":"ShutdownMode", + "Type":"UNKNOWN", + "VirtualSensor":true, + "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Formula":"WEIGHTED_AVG", + "Combination":["VIRTUAL-SKIN"], + "Coefficient":[1.0], + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", 57.0, "NAN"], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 5.9, 1.9], + "SeverityReference": "battery", + "Multiplier":0.001, + "SendCallback": true, + "SendPowerHint": true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, + { + "Name": "VIRTUAL-SKIN", + "Type": "SKIN", + "Version": "2.3", + "VirtualSensor": true, + "TriggerSensor": ["soc_therm", "rffe_therm", "charger_therm", "modem_therm", "gnss_tcxo_therm"], + "Formula": "MAXIMUM", + "Combination": ["VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0], + "HotThreshold": ["NAN", 39.0, 43.0, 45.0, 46.5, 53.0, 65.0], + "HotHysteresis": [0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "SeverityReference": "SkinShutdownModeHighPower", + "Multiplier": 0.001, + "PollingDelay": 300000, + "PassiveDelay": 7000, + "SendCallback": true, + "BindedCdevInfo": [ + { + "CdevRequest": "gxp-cooling", + "LimitInfo": [0, 0, 0, 0, 0, 99, 99] + } + ] + } + ] +}