From bd612e022b2496e01264d6f562d5c93e706ba2f7 Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Thu, 31 Oct 2024 01:14:53 +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: Ic01a4b5c8bdfa242e05bd560297d4e04d1159fc3 --- device-caimito-common.mk | 1 + perf/powerhint-caiman.json | 32 ++++++++ perf/powerhint-komodo.json | 32 ++++++++ perf/powerhint-tokay.json | 32 ++++++++ thermal/thermal_info_config_caiman.json | 5 ++ thermal/thermal_info_config_komodo.json | 5 ++ thermal/thermal_info_config_lpm_caiman.json | 85 +++++++++++++++++++++ thermal/thermal_info_config_lpm_komodo.json | 85 +++++++++++++++++++++ thermal/thermal_info_config_lpm_tokay.json | 85 +++++++++++++++++++++ thermal/thermal_info_config_tokay.json | 5 ++ 10 files changed, 367 insertions(+) create mode 100644 thermal/thermal_info_config_lpm_caiman.json create mode 100644 thermal/thermal_info_config_lpm_komodo.json create mode 100644 thermal/thermal_info_config_lpm_tokay.json diff --git a/device-caimito-common.mk b/device-caimito-common.mk index 12c9b1a5..9a333318 100644 --- a/device-caimito-common.mk +++ b/device-caimito-common.mk @@ -27,6 +27,7 @@ PRODUCT_COPY_FILES += \ ifneq (,$(filter $(TARGET_DEVICE),komodo caiman tokay)) PRODUCT_COPY_FILES += \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_$(TARGET_DEVICE)_proto.json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_proto.json \ + $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/thermal_info_config_lpm_$(TARGET_DEVICE).json:$(TARGET_COPY_OUT_VENDOR)/etc/thermal_info_config_lpm.json \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_estimation_model_$(TARGET_DEVICE).tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_estimation_model.tflite \ $(TARGET_VENDOR_THERMAL_CONFIG_PATH)/vt_prediction_lstm_model_$(TARGET_DEVICE).tflite:$(TARGET_COPY_OUT_VENDOR)/etc/vt_prediction_lstm_model.tflite ifneq (,$(filter $(TARGET_BUILD_VARIANT), userdebug eng)) diff --git a/perf/powerhint-caiman.json b/perf/powerhint-caiman.json index 54e0fea5..c9dcc4a4 100644 --- a/perf/powerhint-caiman.json +++ b/perf/powerhint-caiman.json @@ -888,6 +888,26 @@ "ResetOnInit": true, "Type": "Property" }, + { + "Name": "ntc_critical_trip", + "Path": "/dev/thermal/tz-by-name/quiet_therm/trip_point_1_temp", + "Values": [ + "60000", + "70000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "ntc_hot_trip", + "Path": "/dev/thermal/tz-by-name/quiet_therm/trip_point_2_temp", + "Values": [ + "65000", + "75000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, { "Name": "MIFTargetLoad", "Path": "/sys/class/devfreq/17000010.devfreq_mif/interactive/target_load", @@ -3398,6 +3418,18 @@ "Duration": 0, "Value": "1" }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_critical_trip", + "Duration": 0, + "Value": "70000" + }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_hot_trip", + "Duration": 0, + "Value": "75000" + }, { "PowerHint": "GAME", "Node": "PMU_POLL", diff --git a/perf/powerhint-komodo.json b/perf/powerhint-komodo.json index cde32f93..0665622c 100644 --- a/perf/powerhint-komodo.json +++ b/perf/powerhint-komodo.json @@ -888,6 +888,26 @@ "ResetOnInit": true, "Type": "Property" }, + { + "Name": "ntc_critical_trip", + "Path": "/dev/thermal/tz-by-name/quiet_therm/trip_point_1_temp", + "Values": [ + "60000", + "70000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "ntc_hot_trip", + "Path": "/dev/thermal/tz-by-name/quiet_therm/trip_point_2_temp", + "Values": [ + "65000", + "75000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, { "Name": "MIFTargetLoad", "Path": "/sys/class/devfreq/17000010.devfreq_mif/interactive/target_load", @@ -3398,6 +3418,18 @@ "Duration": 0, "Value": "1" }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_critical_trip", + "Duration": 0, + "Value": "70000" + }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_hot_trip", + "Duration": 0, + "Value": "75000" + }, { "PowerHint": "GAME", "Node": "PMU_POLL", diff --git a/perf/powerhint-tokay.json b/perf/powerhint-tokay.json index 5ba38b72..0224202e 100644 --- a/perf/powerhint-tokay.json +++ b/perf/powerhint-tokay.json @@ -888,6 +888,26 @@ "ResetOnInit": true, "Type": "Property" }, + { + "Name": "ntc_critical_trip", + "Path": "/dev/thermal/tz-by-name/quiet_therm/trip_point_1_temp", + "Values": [ + "60000", + "70000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, + { + "Name": "ntc_hot_trip", + "Path": "/dev/thermal/tz-by-name/quiet_therm/trip_point_2_temp", + "Values": [ + "65000", + "75000" + ], + "DefaultIndex": 0, + "ResetOnInit": true + }, { "Name": "MIFTargetLoad", "Path": "/sys/class/devfreq/17000010.devfreq_mif/interactive/target_load", @@ -3398,6 +3418,18 @@ "Duration": 0, "Value": "1" }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_critical_trip", + "Duration": 0, + "Value": "70000" + }, + { + "PowerHint": "THERMAL_ShutdownMode_EMERGENCY", + "Node": "ntc_hot_trip", + "Duration": 0, + "Value": "75000" + }, { "PowerHint": "GAME", "Node": "PMU_POLL", diff --git a/thermal/thermal_info_config_caiman.json b/thermal/thermal_info_config_caiman.json index 6369238a..a177c704 100644 --- a/thermal/thermal_info_config_caiman.json +++ b/thermal/thermal_info_config_caiman.json @@ -49,6 +49,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_komodo.json b/thermal/thermal_info_config_komodo.json index e1ae5722..48793e79 100644 --- a/thermal/thermal_info_config_komodo.json +++ b/thermal/thermal_info_config_komodo.json @@ -49,6 +49,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_caiman.json b/thermal/thermal_info_config_lpm_caiman.json new file mode 100644 index 00000000..543f27d8 --- /dev/null +++ b/thermal/thermal_info_config_lpm_caiman.json @@ -0,0 +1,85 @@ +{ + "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":[55000.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": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Formula":"WEIGHTED_AVG", + "Combination":["VIRTUAL-SKIN"], + "Coefficient":[1.0], + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", 55.0, "NAN"], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 4.9, 1.9], + "SeverityReference": "battery", + "Multiplier":0.001, + "SendCallback": true, + "SendPowerHint": true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, + { + "Name": "VIRTUAL-SKIN", + "Type": "SKIN", + "Version": "6.1", + "VirtualSensor": true, + "TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Formula": "MAXIMUM", + "Combination": ["VIRTUAL-SKIN-MODEL-UPDATED", "VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0, "VIRTUAL-SKIN-LEGACY-SHUTDOWN"], + "CoefficientType":["CONSTANT", "SENSOR"], + "HotThreshold": ["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 65.0], + "HotHysteresis": [0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "SeverityReference": "SkinShutdownModeHighPower", + "Multiplier": 0.001, + "SendCallback": true, + "PollingDelay": 300000, + "PassiveDelay": 7000, + "PredictorInfo": { + "Sensor": "VIRTUAL-SKIN-LSTM-MODEL" + }, + "BindedCdevInfo": [ + { + "CdevRequest": "gxp-cooling", + "LimitInfo": [0, 0, 0, 0, 0, 6, 6] + } + ] + } + ] +} diff --git a/thermal/thermal_info_config_lpm_komodo.json b/thermal/thermal_info_config_lpm_komodo.json new file mode 100644 index 00000000..543f27d8 --- /dev/null +++ b/thermal/thermal_info_config_lpm_komodo.json @@ -0,0 +1,85 @@ +{ + "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":[55000.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": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Formula":"WEIGHTED_AVG", + "Combination":["VIRTUAL-SKIN"], + "Coefficient":[1.0], + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", 55.0, "NAN"], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 4.9, 1.9], + "SeverityReference": "battery", + "Multiplier":0.001, + "SendCallback": true, + "SendPowerHint": true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, + { + "Name": "VIRTUAL-SKIN", + "Type": "SKIN", + "Version": "6.1", + "VirtualSensor": true, + "TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Formula": "MAXIMUM", + "Combination": ["VIRTUAL-SKIN-MODEL-UPDATED", "VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0, "VIRTUAL-SKIN-LEGACY-SHUTDOWN"], + "CoefficientType":["CONSTANT", "SENSOR"], + "HotThreshold": ["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 65.0], + "HotHysteresis": [0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "SeverityReference": "SkinShutdownModeHighPower", + "Multiplier": 0.001, + "SendCallback": true, + "PollingDelay": 300000, + "PassiveDelay": 7000, + "PredictorInfo": { + "Sensor": "VIRTUAL-SKIN-LSTM-MODEL" + }, + "BindedCdevInfo": [ + { + "CdevRequest": "gxp-cooling", + "LimitInfo": [0, 0, 0, 0, 0, 6, 6] + } + ] + } + ] +} diff --git a/thermal/thermal_info_config_lpm_tokay.json b/thermal/thermal_info_config_lpm_tokay.json new file mode 100644 index 00000000..dab369e0 --- /dev/null +++ b/thermal/thermal_info_config_lpm_tokay.json @@ -0,0 +1,85 @@ +{ + "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":[55000.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": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Formula":"WEIGHTED_AVG", + "Combination":["VIRTUAL-SKIN"], + "Coefficient":[1.0], + "HotThreshold":["NAN", "NAN", "NAN", "NAN", "NAN", 55.0, "NAN"], + "HotHysteresis":[0.0, 1.9, 1.9, 1.9, 1.9, 4.9, 1.9], + "SeverityReference": "battery", + "Multiplier":0.001, + "SendCallback": true, + "SendPowerHint": true, + "PollingDelay":300000, + "PassiveDelay":7000 + }, + { + "Name": "VIRTUAL-SKIN", + "Type": "SKIN", + "Version": "6.1", + "VirtualSensor": true, + "TriggerSensor": ["north_therm", "soc_therm", "charging_therm", "disp_therm", "quiet_therm", "usb_pwr_therm", "rfpa_therm", "btmspkr_therm"], + "Formula": "MAXIMUM", + "Combination": ["VIRTUAL-SKIN-MODEL-UPDATED", "VIRTUAL-SKIN-LEGACY"], + "Coefficient": [1.0, "VIRTUAL-SKIN-LEGACY-SHUTDOWN"], + "CoefficientType":["CONSTANT", "SENSOR"], + "HotThreshold": ["NAN", 39.0, 43.0, 45.0, 46.5, 52.0, 60.0], + "HotHysteresis": [0.0, 1.9, 1.9, 1.9, 1.4, 1.9, 1.9], + "SeverityReference": "SkinShutdownModeHighPower", + "Multiplier": 0.001, + "SendCallback": true, + "PollingDelay": 300000, + "PassiveDelay": 7000, + "PredictorInfo": { + "Sensor": "VIRTUAL-SKIN-LSTM-MODEL" + }, + "BindedCdevInfo": [ + { + "CdevRequest": "gxp-cooling", + "LimitInfo": [0, 0, 0, 0, 0, 6, 6] + } + ] + } + ] +} diff --git a/thermal/thermal_info_config_tokay.json b/thermal/thermal_info_config_tokay.json index 30a492c8..8c5da4a5 100644 --- a/thermal/thermal_info_config_tokay.json +++ b/thermal/thermal_info_config_tokay.json @@ -49,6 +49,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 }, {