From 756cd135786e8b77fa8355edc3f60e0c7240dc5f Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Thu, 5 Dec 2024 01:34:18 +0000 Subject: [PATCH] thermal: update policy for earlier USB port throttling/warning Bug: 377956961 Test: confirm usbc throttling and warning UI by emul_temp Flag: EXEMPT config update Change-Id: Ieb5f1bb93a9f96ba855c7ed05cdc8b9f033392ca --- thermal/thermal_info_config_caiman.json | 30 +++++++++++-------- .../thermal_info_config_charge_caiman.json | 19 ++++++++---- .../thermal_info_config_charge_komodo.json | 19 ++++++++---- thermal/thermal_info_config_charge_tokay.json | 19 ++++++++---- thermal/thermal_info_config_komodo.json | 30 +++++++++++-------- thermal/thermal_info_config_tokay.json | 30 +++++++++++-------- 6 files changed, 93 insertions(+), 54 deletions(-) diff --git a/thermal/thermal_info_config_caiman.json b/thermal/thermal_info_config_caiman.json index d1ec90fb..6369238a 100644 --- a/thermal/thermal_info_config_caiman.json +++ b/thermal/thermal_info_config_caiman.json @@ -1133,22 +1133,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 }, @@ -1156,13 +1163,12 @@ "Name": "VIRTUAL-USB-UI", "Type": "USB_PORT", "VirtualSensor": true, - "Formula": "WEIGHTED_AVG", + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 57.0, "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 1.9, 0.0], - "Multiplier": 0.001, + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [57000.0, 52000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 2.0, "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 0.9, 0.0], "PollingDelay": 300000, "PassiveDelay": 7000, "SendCallback": true diff --git a/thermal/thermal_info_config_charge_caiman.json b/thermal/thermal_info_config_charge_caiman.json index f2ad61be..52174348 100644 --- a/thermal/thermal_info_config_charge_caiman.json +++ b/thermal/thermal_info_config_charge_caiman.json @@ -265,22 +265,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 } diff --git a/thermal/thermal_info_config_charge_komodo.json b/thermal/thermal_info_config_charge_komodo.json index 1851ceb4..07150dae 100644 --- a/thermal/thermal_info_config_charge_komodo.json +++ b/thermal/thermal_info_config_charge_komodo.json @@ -276,22 +276,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 } diff --git a/thermal/thermal_info_config_charge_tokay.json b/thermal/thermal_info_config_charge_tokay.json index 740ecfa1..e5cc66fd 100644 --- a/thermal/thermal_info_config_charge_tokay.json +++ b/thermal/thermal_info_config_charge_tokay.json @@ -243,22 +243,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 } diff --git a/thermal/thermal_info_config_komodo.json b/thermal/thermal_info_config_komodo.json index 045e4ad8..e1ae5722 100644 --- a/thermal/thermal_info_config_komodo.json +++ b/thermal/thermal_info_config_komodo.json @@ -1156,22 +1156,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 }, @@ -1179,13 +1186,12 @@ "Name": "VIRTUAL-USB-UI", "Type": "USB_PORT", "VirtualSensor": true, - "Formula": "WEIGHTED_AVG", + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 57.0, "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 1.9, 0.0], - "Multiplier": 0.001, + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [57000.0, 52000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 2.0, "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 0.9, 0.0], "PollingDelay": 300000, "PassiveDelay": 7000, "SendCallback": true diff --git a/thermal/thermal_info_config_tokay.json b/thermal/thermal_info_config_tokay.json index 05b1ead8..30a492c8 100644 --- a/thermal/thermal_info_config_tokay.json +++ b/thermal/thermal_info_config_tokay.json @@ -1090,22 +1090,29 @@ ] }, { - "Name": "VIRTUAL-USB-THROTTLING", + "Name": "USB-MINUS-CHARGING", "Type": "UNKNOWN", "VirtualSensor": true, "Formula": "WEIGHTED_AVG", + "Combination": ["usb_pwr_therm", "charging_therm"], + "Coefficient": [1.0, -1.0] + }, + { + "Name": "VIRTUAL-USB-THROTTLING", + "Type": "UNKNOWN", + "VirtualSensor": true, + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 55.0, "NaN", "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 1.9, 0.0, 0.0], + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [55000.0, 50000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", 2.0, "NaN", "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0], "BindedCdevInfo": [ { "CdevRequest": "usbc-port", "LimitInfo": [0, 0, 0, 0, 1, 1, 1] } ], - "Multiplier": 0.001, "PollingDelay": 300000, "PassiveDelay": 7000 }, @@ -1113,13 +1120,12 @@ "Name": "VIRTUAL-USB-UI", "Type": "USB_PORT", "VirtualSensor": true, - "Formula": "WEIGHTED_AVG", + "Formula": "COUNT_THRESHOLD", "TriggerSensor": "usb_pwr_therm", - "Combination": ["usb_pwr_therm"], - "Coefficient": [1.0], - "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 57.0, "NaN"], - "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 1.9, 0.0], - "Multiplier": 0.001, + "Combination": ["usb_pwr_therm", "usb_pwr_therm", "USB-MINUS-CHARGING"], + "Coefficient": [57000.0, 52000.0, 2000.0], + "HotThreshold": ["NaN", "NaN", "NaN", "NaN", "NaN", 2.0, "NaN"], + "HotHysteresis": [0.0, 0.0, 0.0, 0.0, 0.0, 0.9, 0.0], "PollingDelay": 300000, "PassiveDelay": 7000, "SendCallback": true