Commit graph

85 commits

Author SHA1 Message Date
David Chao
313e0cbebb thermal: update charging thermal throttling
Increase K_I and PowerWeight to reduce temperature
and charging throttling overshoots.

Bug: 338150302
Test: boot and charging thermal throtlting worked properly.
Change-Id: Ia7b2b5f7b2f8d62d1cde800be149993b284f72d4
2024-06-06 18:39:52 +00:00
sashwinbalaji
b59526a5d0 thermal: Add residency stats for vskin-charge by charger type
Use thb_hda value to find charger type and split vskin-charge into
different categories on basis of charger type.
For each category if charger not active, store time in bucket 0 and if
active store residency in higher buckets.
Thresholds: [-200, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55]

Bug: 341872098
Test: Push locally and verify stats by connecting to different chargers
Change-Id: I15738686a0a6b263ab4b3f2caf1a22d7c31c4518
2024-06-05 11:26:13 +08:00
sashwinbalaji
bd273f003d thermal: Clean up stats config
- Remove stats monitoring for sub-sensors since they don't denote a
  particular hotspot.
- Remove stats monitoring for wingboard configs.
- For vskin-legacy, vskin-model, vskin-speaker improve the resolution of
  buckets by splitting range [49, 55] into [49, 51, 53, 55]

Bug: 341872098
Test: Push config and verify lshal
Change-Id: Iabff63922c283a595fa7ec2dfa8af539629d4064
2024-05-28 09:34:50 +08:00
Sayanna Chandula
1bcb265b5c Merge "thermal: update legacy virtual senor formulas" into 24D1-dev 2024-05-23 18:35:26 +00:00
Sayanna Chandula
3cffe299f7 Merge "thermal: set virtualskin model cache interval to 7 seconds" into 24D1-dev 2024-05-23 18:34:57 +00:00
Sayanna Chandula
8530c2e189 Merge "thermal: add explicit passive delay to enable step ratio" into 24D1-dev 2024-05-23 18:34:07 +00:00
Jikai Ma
614af2385c thermal: update legacy virtual senor formulas
- generated legacy formulas with DVT and CUJ data
- removed 'battery' thermistor from sensor combination list
- removed 'LINEAR' formulas

Bug: 342227291
Test: verified thermal hal service starts properly with it
Change-Id: Iff59072d432ff98afe852295745cebd81ec73d15
Signed-off-by: Jikai Ma <Jikai@google.com>
2024-05-23 18:16:04 +00:00
Sayanna Chandula
108e06a214 thermal: set virtualskin model cache interval to 7 seconds
With previous samples being used in vt estimation, the sampling period
between vt estimation calls impact vt accuracy. Currently vt model is
using default cache interval of 2 seconds. This change sets the cache
interval to 7 seconds explicitly to match with passive delay

Bug: 341967304
Test: Check vt estimation invoke calls with frequency thermalservice dump

Change-Id: Ic6a38939b2bec88a66c87517e6efa548566ea877
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-05-23 10:16:33 -07:00
Sayanna Chandula
019bef5229 thermal: add explicit passive delay to enable step ratio
Due to defalut passive delay of 2 seconds being used for the VT sensor,
previous samples are ignored at 7 seconds intervals. This change sets
explicit passive_delay for VT sensor to make sure we are not ignoring
previous samples and apply step_ratio

Bug: 342257359
Test: Check VIRTUAL-SKIN-MODEL-UPDATED values at run time

Change-Id: I18a9e4913b8153b8d2c3a313451338a9f1b6ca0c
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-05-22 17:05:41 -07:00
Treehugger Robot
e1b30ceb40 Merge "thermal: updated BTS equations" into 24D1-dev 2024-05-21 18:04:30 +00:00
Ramya Subramanian
3359abda9e thermal: updated BTS equations
Bug: 297083757
Test: Tested on CM4 boot to home and with thermal recorder

Change-Id: Ia6071a8c70e19cebeab909ca6c3e36138c93badc
Signed-off-by: Ramya Subramanian <rsubr@google.com>
2024-05-20 21:10:13 +00:00
Sayanna Chandula
bb7c7b5371 thermal: virtualtemp: enable step ratio for vt model
Enabling step ration for vt model would dampen the vt which seems
to be very sensitive to some of the thermistor changes

Bug: 338284524
Test: Build and boot on device. Monitor Virtual Temperature

Change-Id: Ia45f683e3bef9dc1becf74c683c408ffdecf6e48
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-05-15 23:52:04 +00:00
Sayanna Chandula
59dc0432dd Merge "thermal: virtualtemp: update threshold for swithcing to legacy" into 24D1-dev 2024-05-15 00:51:39 +00:00
David Chao
b7ca1c1e1a thermal: Update charging thermal throttling
Reduce temperature and charging throttling overshoots by fine-tuning PID
parameters.

Bug: 303547723
Test: boot and charging thermal throtlting worked properly.
Change-Id: Icaeef76998347167976a1ef3606f417db3c5a380
2024-05-10 23:26:57 +00:00
Sayanna Chandula
640f2f6672 thermal: virtualtemp: update threshold for swithcing to legacy
For mmWAVE test cases, legacy equation is under predicting heavily
resulting in virtua-skin switching to vt legacy even though the
model output was more accurate. This change increases the threshold
to address the same

Bug: 338284524
Test: Build and boot on device

Change-Id: I1c7a14a1d9042a2370c30490969d29294fc95f79
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-05-10 14:30:29 -07:00
Sayanna Chandula
3014b79e70 thermal: virtualtemp: update vt models with dvt and cuj data
- Update VT models trained with dvt and cuj data
- Use backup sensor during undersampling
- Remove battery thermistor from VT model prediction

Bug: 337512118
Bug: 338596757

Test: Build and boot on device. Check VT through dumpsys
adb shell dumpsys thermalservice

Change-Id: Id26238f7baf58e23ef5e1c771d2ee6cf8968ec8e
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-05-07 14:36:41 -07:00
Peter (YM)
c8155e9f31 thermal: enable frequency based constrain on gpu thermal throttle
Replacec cdevceiling and hardlimit information with freuqencies in
thermal config

Bug: 336698561
Test: Flash Build and boot to home, run adb dumpsys android.hardware.thermal.IThermal/default, check the cdevceiling and hardlimit number for gpu
Change-Id: If5d105208ea055230dbbf4b6ecbac799b04a18db
Signed-off-by: Peter (YM) <peterym@google.com>
2024-05-06 02:30:49 +00:00
Treehugger Robot
30eb0787d6 Merge "thermal: Move TPU to the VSKIN-SOC PID loop" into 24D1-dev 2024-05-03 17:00:32 +00:00
TeYuan Wang
1a2a883b47 thermal: Move TPU to the VSKIN-SOC PID loop
Bug: 322223131
Test: run TPU test
Change-Id: I9ed71aed7d2469bbeab0e792d72b2e4c5f618ebc
2024-05-02 23:40:07 +00:00
sashwinbalaji
77bd92b57d thermal: Expose VCharge-Sensors with throttling
Expose virtual charge sensors to which throttling is binded to and
hide those which don't have.

Unhide:
 - VIRTUAL-SKIN-CHARGE-WIRED
 - VIRTUAL-SKIN-CHARGE-PERSIST
Hide:
 - VIRTUAL-SKIN-CHARGE

Bug: 336193005
Test: Verify dumpsys
Change-Id: I4d83f6af17fccb7de8d053c9d981163c9dde0ea3
2024-05-02 09:10:14 +08:00
Jikai Ma
e27cfe4bb8 thermal: update legacy formula with DVT test data
Bug: 320714468

Test: side load to device and successfully start thermal hal service.
Change-Id: I8189d7d7c94d590cc06ac82893d6b3dfd730585a
Signed-off-by: Jikai Ma <jikai@google.com>
2024-05-01 01:11:26 +00:00
Sayanna Chandula
dbb9ba6344 thermal: fix typo in thermal config
Bug: 337094450
Test: Build and boot on device

Change-Id: I5884945aa8be3e1c881b49f5bb379a2ab3e05afb
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-04-29 18:29:26 -07:00
Sayanna Chandula
670fd87775 Merge changes from topic "p24-vt-dvt" into 24D1-dev
* changes:
  thermal: update vt models with dvt data
  thermal: add smooth transition from model to legacy vt
2024-04-29 20:30:39 +00:00
Sayanna Chandula
dd66c5faaa thermal: add smooth transition from model to legacy vt
- Remove backup sensor and enable under sampling
- Clamp VT_MODEL prediction based on training set max_surface
- Use VT_MODEL_LEGACY_DIFF to decide on switch
- Enable smooth transition with weights

Bug: 336265406
Test: Build and boot on device. Test smooth transition

Change-Id: If30a87a24b12b0af5527d9c05be7a14bb06dcfac
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-04-27 12:15:26 -07:00
Wei Wang
c5a9cdb1ff Merge "thermal: use frequency to define hard limit and cdev ceiling" into 24D1-dev 2024-04-26 17:43:37 +00:00
Jikai Ma
878c5bad5c thermal: fix thermal config typo
Bug: 337094450
Test: side loaded to device and successfully start thermal service.
Change-Id: Ied79a83d5c0e9d4c9393ffa4ef550b382b7b79e1
2024-04-25 19:57:19 -07:00
Peter (YM)
681064ae17 thermal: use frequency to define hard limit and cdev ceiling
Test: Boot to home and flash on device
Bug: 330780045
Change-Id: I428e14f354a5897601cbcaf8f7bbbeb6a0cc5d8f
Signed-off-by: Peter (YM) <peterym@google.com>
2024-04-26 02:38:45 +00:00
Sayanna Chandula
d3d8be7a77 Merge "thermal: update abnormal thresholds for model-legacy-diff" into 24D1-dev 2024-04-19 21:34:41 +00:00
Jikai Ma
768a123df2 Merge "thermal: add support of LSTM model sensors" into 24D1-dev 2024-04-17 20:30:49 +00:00
Jikai Ma
7a7ba4ae75 thermal: add support of LSTM model sensors
- add tflite model files
- add lstm model sensors to thermal config
- add lstm model sensor to virtual skin prediction

Bug: 308179047
Test: build and validate thermal service

Change-Id: Iaff613d75b3766bfbdf40b391e453a94172872a3
Signed-off-by: Jikai Ma <jikai@google.com>
2024-04-16 14:44:38 -07:00
Sayanna Chandula
96ff84c82f thermal: update abnormal thresholds for model-legacy-diff
Reduce threshold to 7C to gather more traces to analyze

Bug: 333110670
Test: Build and boot on device

Change-Id: I2a9ff381055fedaea18791fc030832a8b0877105
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-04-15 22:57:35 -07:00
TeYuan Wang
1ac7f7c59c thermal: adjust CPU cdev_ceiling
Bug: 329697728
Test: run camera test
Change-Id: I410bfdf7d26883985b7f1882d6f449794549b631
2024-04-12 17:58:44 +00:00
Sayanna Chandula
a8fc85d8e7 thermal: update abnormal thresholds for model-legacy-diff
Given that we have very few traces/events uploaded for 12C threshold,
this change reduces the threshold to 10C to help collect more data
to analyze infield abnormalities.

Bug: 333110670
Test: Build and boot on device

Change-Id: Icd3357e543bfd612b856d843a7cf56486361ed81
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-04-10 10:32:53 -07:00
sashwinbalaji
9b6048ab03 thermal: Remove deprecated power rails
Remove the below power rails as they're going to be replaced with
different ones for better ODPM coverage.

  - S8S_VDD_G3D_L2
  - L9S_GNSS_CORE

Bug: 331556280
Test: Push config and verify thermal logs
Change-Id: Ic5c6cb7c4ddae258c89cbe3cb50a104f7044e016
2024-04-01 12:47:41 +08:00
TeYuan Wang
37b99c032d thermal: update rule to identify non WLC scenarios
Change the rule to identify wireless charge according to the latest
hda definition from bms driver pa/2736243

Bug: 324267311
Test: boot to home
Change-Id: Ice9b38201cbbe868784ac389e799cc24e8f8b7ff
2024-03-22 22:53:22 +00:00
Treehugger Robot
e0d2eae89d Merge "therma: disable LIGHT tier throttling when gaming" into 24D1-dev 2024-03-22 22:25:53 +00:00
TeYuan Wang
cbfd667718 therma: disable LIGHT tier throttling when gaming
We already have the CPU scheduler optimization for game mode to sustain
the power and perf, so remove the CPU thermal policy at lower
temperature to avoid the interfence on CPU scheduler.

Bug: 329697728
Test: run genshin

Change-Id: Ib0d47b3de7b3550a3af4db37ef062f8c5d2ea262
2024-03-22 02:23:43 +00:00
Treehugger Robot
d420e49217 Merge "thermal: update cdev ceiling for LITTLE cores" into 24D1-dev 2024-03-21 21:27:38 +00:00
Sayanna Chandula
6f59876ad6 thermal: enable input data validation
Update tflite models with metadata containing input data ranges.
Enable input data validation and backup sesor.
Add offsets based off temperature ranges.

Bug: 319167815
Bug: 328789394
Test: Build and boot on device. Test backup sensor and offsets

Change-Id: Icdc0c1a1fe026613e4a1716747335e60aca4edf9
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-03-20 11:49:53 -07:00
Jikai Ma
ca43671583 thermal: update legacy and linear vs formula
- vs formulas generated from EVT 1.1 data

Bug: 320714468
Test: push to device and boot to home

Change-Id: Ife745ac7640ffd284404212706c9bdfdb0500f33
Signed-off-by: Jikai Ma <jikai@google.com>
(cherry picked from commit 859dc39412)
2024-03-20 11:49:46 -07:00
Ramya Subramanian
33e139655f thermal: update cdev ceiling for LITTLE cores
Inefficient OPPs were removed for the LITTLE cores from em table.

This change is to update the cdev ceilings in thermal policy to reflect
the EM changes

Bug: 329876112
Test: Build and boot on device.

Change-Id: I8b9ce12fc22dce0374d2a68a947bd598fd26f936
Signed-off-by: Ramya Subramanian <rsubr@google.com>
2024-03-18 15:50:33 +00:00
TeYuan Wang
ea8c58d2d1 thermal: update WLC charging throttling policy
Bug: 323435751
Test: run the charging test with D250
Change-Id: I028f809f54fdb0c9675c82f34f6aab989b99cb65
2024-02-29 04:59:17 +00:00
TeYuan Wang
f2a7aba99e thermal: reading the thermistor temperature from upstream sysfs
tz_temp callback will invoke thermal_zone_device_update and return the cached temp from thermal core. However, during device resume, the cached temp may be reset to INVALID number before being returned.
So, change the reading path to upstream temp_show which will return the temperature from thermistor driver directly.

Bug: 326252555
Test: adb shell dumpsys thermalservice
Change-Id: I82cf81d940585c4827256804bc9c9397f4b54ccf
2024-02-28 07:30:38 +00:00
Jikai Ma
74226a7a32 Merge "thermal: remove ODPM from legacy and patched linear model" into main 2024-02-16 22:47:36 +00:00
Jikai Ma
89813cd1df thermal: remove ODPM from legacy and patched linear model
- remove ODPM from legacy formulas
- remove ODPM from patched linear formulas
- update VIRTUAL-SKIN-CHARGE formulas

Bug: 320714468
Test: build and boot to home

Change-Id: I974476d45d9ace1740f9fec06af9399db5b7cb59
Signed-off-by: Jikai Ma <jikai@google.com>
2024-02-15 16:03:56 -08:00
Sayanna Chandula
0f72b2af9b Merge "thermal: add historic samples for tflite vt prediction" into main 2024-02-15 01:01:44 +00:00
Sayanna Chandula
ba2f333130 thermal: add historic samples for tflite vt prediction
Add historic samples of past 5 iterations
Remove VSYS_PWR_ODPM from VT prediction

Bug: 315169778
Test: Build and boot on device

Change-Id: I70557d67633cbc4bcfbfe8811beff56353c54085
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-02-14 08:46:08 -08:00
TeYuan Wang
f28d1f2826 thermal: remove battery from TriggerSensor
Bug: 324178403
Test: no thermal error log when thermalHAL init
Change-Id: Ieb08a0b9312a591861384136572ccf1dddd5bbda
2024-02-07 07:43:00 +00:00
Peter (YM)
79029f6bc5 Merge "thermal: update gpu cdev ceiling" into main 2024-02-06 08:07:51 +00:00
Peter (YM)
8887ea09d1 thermal: update gpu cdev ceiling
Align with new GPU available frequency

Bug: 318313844
Test: Run gpu stress test
Change-Id: Iac169739bc72c047afa2564edb540468f48fd3ea
Signed-off-by: Peter (YM) <peterym@google.com>
2024-02-06 06:36:55 +00:00