Commit graph

70 commits

Author SHA1 Message Date
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
Jikai Ma
658d9ff056 thermal: add ODPM to virtual sensor formula
- add to legacy formulas
- add to historic linear formulas

Bug: 320714468
Bug: 315234782
Bug: 307824060

Test: build and boot to home

Change-Id: If395b3281ad180731e93953089c1ca57afdb6b68
Signed-off-by: Jikai Ma <jikai@google.com>
2024-02-05 14:35:41 -08:00
Sayanna Chandula
af4cea32f3 thermal: update vt prediction models with higher odpm average
- Updated vt predictions models with 15 samples average for ODPM rails.
- This reduces VT prediction being very sensitive to power changes
- Remove other ODPM rails from VT prediction except for VSYS_PWR_CAMERA

Bug: 307824060, 322910529
Test: Build and boot on device

Change-Id: Ibb285269d3da86e3d331ea3c7c5a3cd715da0ba2
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-01-31 11:37:55 -08:00
Sayanna Chandula
4e1edbd52d thermal: add 500mC offset for km4 vt prediction
- Add 500mC offset to address underprediction
- Fix issue with VIRTUAL-SKIN-LEGACY-SHUTDOWN thresholds

Bug: 321108353
Test: Build and boot on device

Change-Id: I778e4949308af484ec8ca7a9dfaf27d13c429209
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-01-25 15:15:42 -08:00
Jikai Ma
d1ed787a37 thermal: patched linear model virtual sensor
Bug: 315234782
Test: Build and boot on device
Change-Id: I86806579efe479aafd4a34855e8a0f80176ef1cf
Signed-off-by: Jikai Ma <jikai@google.com>
2024-01-25 18:50:47 +00:00
Sayanna Chandula
2842a579c0 thermal: enable thermal throttling based on virtual-skin-model
- Switch to VIRTUAL-SKIN-MODEL from VIRTUAL-SKIN-LEGACY
- Add a backup shutdown based on VIRTUAL-SKIN-LEGACY
- Remove unnecessary polling delays from few sensors

Bug: 321108353
Test: Build and boot on device

Change-Id: I8b8909ded87ba2b76d5712c474120dbe5ab13c2c
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-01-24 11:18:22 -08:00
Sayanna Chandula
1a93070bd9 Merge "thermal: update vt models with odpm features" into main 2024-01-24 18:28:41 +00:00
Sayanna Chandula
1aa294872c Merge "thermal: Add vskin-model stats monitoring config" into main 2024-01-24 18:28:22 +00:00
Ramya Subramanian
52b4354c2b Merge "Revert^2 "thermal: Update cdev ceiling to match latest EM table"" into main 2024-01-24 16:22:14 +00:00
Sayanna Chandula
9b07c28910 thermal: update vt models with odpm features
Bug: 307824060
Test: Build and boot on device

Change-Id: Ide175d4945ac64e32d33e0c57e486f2691631b78
Signed-off-by: Sayanna Chandula <sayanna@google.com>
2024-01-23 18:00:01 -08:00
sashwinbalaji
37a10af4f0 thermal: Add vskin-model stats monitoring config
Update thermal config as:
- Rename VIRTUAL-SKIN to VIRTUAL-SKIN-LEGACY
In order to differentiate different vt models, we need to define
legacy equation as a sepearate sensor and use it as a reference
for virtual-skin. Later when we want to switch to other models,
we could simply replace the combination for virtual-skin sensor
- Record Stats for
	- VIRTUAL-SKIN-MODEL
	- VIRTUAL-SKIN-MODEL - VIRTUAL-SKIN
  		- At intervals of 500 mdeg (-4500 to 4500)
		- At intervals of 1000 mdef (-13000 to 12000 exlucding
		  -4000 to 4000)
	- Abnormality Monitoring
		- VIRTUAL-SKIN-MODEL [0-55 deg]
		- VIRTUAL-SKIN-MODEL-LEGACY-DIFF [-12000 - 12000 mdeg]

Bug: 320347462
Test: Push config and verify logcat and lshal
Change-Id: I397c8a07cf01abd5d8a7dedf290829a19e21ae87
2024-01-23 17:59:40 -08:00
Ramya Subramanian
23a61319f4 Revert^2 "thermal: Update cdev ceiling to match latest EM table"
This reverts commit 5536e28fd2.

Reason for revert: tested on EVT1.1 TK and KM

Change-Id: Ifc3a5dce761ff86f9ac33597e88ccd77768e142a
2024-01-22 21:26:18 +00:00
Jikai Ma
305646c5f6 thermal: update virtual sensor formula for EVT devices
Bug: 320714468
Test: boot to home
Change-Id: I14b945a520df0466ee6f024983283543e2b363fe
Signed-off-by: Jikai Ma <jikai@google.com>
2024-01-22 10:38:00 -08:00
samou
8e7dc247a7 thermal: remove brownout event
The battery_mitigation takes over the brownout event
and informs subsystems to do mitigation.

Bug: 319285945
Change-Id: I58e0a9e0469575096f34243e73c1e32474eea006
Signed-off-by: samou <samou@google.com>
2024-01-11 14:02:56 +00:00
Ramya Subramanian
5536e28fd2 Revert "thermal: Update cdev ceiling to match latest EM table"
This reverts commit 520b88f848.

Reason for revert: KM4 DVFS v2 tables are not merged to ToT yet. Need to keep this open until thats merged

Change-Id: Id3848230a675ef7a684f7f40a9b7083492dfab58
2024-01-10 17:33:47 +00:00
Ramya Subramanian
520b88f848 thermal: Update cdev ceiling to match latest EM table
Bug: 318313844
Test: Tested on EVT1.0(A0) TK4 and Tskin controlled to 45C with MH offscreen, all 3 devices booted home

Change-Id: I3e10a1cd9c4493c9bb5f6a08a64e68b04713c41a
Signed-off-by: Ramya Subramanian <rsubr@google.com>
2024-01-10 16:35:18 +00:00