Commit graph

56 commits

Author SHA1 Message Date
TeYuan Wang
1099688053 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
2025-01-16 17:53:32 +00:00
Sam Ou
b6dbbf5e11 Merge "thermal: Remove bcl related tzones" into main 2024-09-24 05:51:13 +00:00
Peter (YM)
6a63e26b97 Merge "thermal: read thermistor temp from sysfs" into main 2024-08-19 04:10:06 +00:00
Peter (YM)
959543581d thermal: read thermistor temp from sysfs
- avoid wrong sensor value reading for thermalHAL

Bug: 327327502
Test: Build to boot to home
Flag: EXEMPT (bug 337358613)
Change-Id: I8b6c828896159af3d4a0fbe6023a1097b0d6dc77
Signed-off-by: Peter (YM) <peterym@google.com>
2024-08-16 06:51:14 +00:00
samou
b319347637 thermal: Remove bcl related tzones
Flag: EXEMPT tuning changes
Bug: 349935208
Test: Confirm boot
Change-Id: I4dd7581ac8a5ef5756f00b91b54160fe27dfe939
Signed-off-by: samou <samou@google.com>
2024-08-06 07:45:53 +00:00
sashwinbalaji
d406d43bcb thermal: Update init_thermal_config
- Validate for display panel availability only in userdebug builds.

- Add check to fall back to wingboard config for charging mode as well.

- Move fallback to backup config for proto and wingboard to init rc
  file.

Bug: 338295174
Flag: EXEMPT NDK
Test: Local build and verify init_thermal_config and property
Change-Id: I4b2db92df1d74be4038e256ab6e25ee616c5feb6
2024-07-26 07:33:03 +00:00
Treehugger Robot
16ae99c8bd Merge "thermal: Update charging thermal throttling" into main 2024-06-07 17:51:07 +00:00
David Chao
fffedb6361 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: Ief0aec34e05cc9639ae995e1a230228e7591cf36
2024-06-06 18:40:00 +00:00
sashwinbalaji
dae7860b75 thermal: update vskin-open sub1 equation
Update vskin-open-sub-1 equation to have better correlation for safety
cases.

Bug: 322147413
Test: Push config and verify lshal
Change-Id: I338f4ddf289f9388c3601149bf22312a81f6af43
2024-06-06 10:59:56 +08:00
sashwinbalaji
8d517a9b49 thermal: Update vskin-speaker model
- Use dvt data to train the model
- Fall back to vskin-speaker-legacy:
	- if all samples not collected
	- if vskin-speaker-model temp < 20degC
	- if vskin-speaker-model temp >= 57degC
- Add timeResolution to avoid duplicate readings issue.

Bug: 343157242
Test: Push config and tflite model to verify lshal and logcat
Change-Id: I2140a92ae3b19825ec9542e3ec65a365bec2e66f
2024-06-06 10:59:56 +08:00
sashwinbalaji
f29dae4163 thermal: Update vskin-model
Continue with existing model but with minor changes:
	- Add max_sample_interval_ms
	- Add backupSensor
	- Add TimeResolution

Bug: 343189782
Test: Local push and verify logs
Change-Id: I31744360d6fcb21542139b78486a35324f5ce94a
2024-06-06 10:59:56 +08:00
sashwinbalaji
754a1ba418 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-06 10:59:56 +08:00
sashwinbalaji
b34f70a943 thermal: Update residency stats
- Add residency monitoring for vskin-od by severity and by threshold as
  [31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57]
- Update vskin-speaker model threshold to align with other vskin
  thresholds.
- Add vskin-legacy and set vskin-legacy and vskin-model threshold also
  to align with other thresholds.

Bug: 343098605
Test: Local push and verify lshal
Change-Id: I6fc484c20910a4faff8885d8b3d21d4b901b9823
2024-06-06 10:59:56 +08:00
Treehugger Robot
2d73f97fb4 Merge "thermal: Add step ratio for IS_WLC" into 24D1-dev 2024-05-17 06:39:09 +00:00
Treehugger Robot
28eb028475 Merge "thermal: Add step_ratio to VSkin-Speaker-Model" into 24D1-dev 2024-05-17 05:50:03 +00:00
sashwinbalaji
dcff9328a0 thermal: Update VDisplay
- Update vskin outer display equation
- Add vskin inner display = vskin open

Bug: 318451991
Test: Local build and verify
Change-Id: I05fa690fae1d14bf1db9b578529e3cdcf955e467
2024-05-16 10:29:40 +08:00
sashwinbalaji
0d5adab585 thermal: Add step_ratio to VSkin-Speaker-Model
Add a step ratio of 0.4 to vskin-speaker-model prediction.
This will help to:
- reduce the noise due to overfitting
- avoid sudden jump in temperature

Bug: 339522501
Test: Push to device and verify dumpsys and thermal log
Change-Id: Ia266e6135efca77e6dfee79b7111c9be1d53b67a
2024-05-15 17:32:54 +08:00
sashwinbalaji
010bf93429 thermal: Add step ratio for IS_WLC
Since vskin-wired and vskin-wlc equation are different and both control
the same cooling device, add step ratio to ensure smooth transition when
user switches charging mode.

Bug: 331904373
Test: Push locally and verify thermal log
Change-Id: Ibda3e8dfd87dbb0bd5d72adef3cead51f48e45af
2024-05-15 08:53:40 +08:00
Treehugger Robot
a410fdff0b Merge "thermal: Update vskin-close-sub-1 equation" into 24D1-dev 2024-05-10 05:26:55 +00:00
Wei Wang
4c4a4459d5 Merge "thermal: Apply special thermal config for wingboard/MLB device" into 24D1-dev 2024-05-09 04:58:15 +00:00
sashwinbalaji
1c5e52ad45 thermal: Update vskin-close-sub-1 equation
Update vskin-close subsenor equation to better correlate for safety
cases.

Bug: 338512090
Test: Push config and verify lshal
Change-Id: I679ee99227bd39c9d0b3615dec82a186ab524866
2024-05-09 00:32:21 +08:00
Treehugger Robot
f15b631448 Merge "thermal: Support undersampling for vskin-models" into 24D1-dev 2024-05-07 00:14:35 +00:00
sashwinbalaji
f8e414dbd8 thermal: Support undersampling for vskin-models
Enable undersampling for VSkin-Model adn VSkin-Speaker-Model, this will
enable to avoid unnecesary read temp fails when enough samples not
collected.

Bug: 338920071
Test: Push config and verify for thermal error logs
Change-Id: Ic8af11170c0273286068c12493615c4b838ecacc
2024-05-06 16:26:45 +08:00
Peter (YM)
04c7d884b6 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: I7b582b3d19ddea8c5c3a643d57972167ed5b6c87
Signed-off-by: Peter (YM) <peterym@google.com>
2024-05-06 02:31:40 +00:00
TeYuan Wang
15c78bac5b thermal: Move TPU to the VSKIN-SOC PID loop
Bug: 322223131
Test: run TPU test
Change-Id: I4996071d1618808068dddddd984f3eca4da32517
2024-05-02 23:38:47 +00:00
sashwinbalaji
79277084b0 thermal: Apply special thermal config for wingboard/MLB device
- Add new thermal config for wingboard without dependency on:
  - chg_mdis
  - inner_brightness zone
- Update init_thermal_config to check if wingboard, if so use the custom
  config

Bug: 335005016
Test: Build and boot to verify thermal logs
Change-Id: I58b9517de2acdfca0e371ce1a5dfe486eb6c15ee
2024-04-29 11:47:49 +08:00
Wei Wang
a4eeccb5b3 Merge "thermal: use frequency to define hard limit and cdev ceiling" into 24D1-dev 2024-04-26 17:43:37 +00:00
Treehugger Robot
4030a99fc2 Merge "thermal: Add VSkin-Speaker Model" into 24D1-dev 2024-04-26 07:47:12 +00:00
Treehugger Robot
3ab2c71536 Merge "thermal: Update VSkin-Model" into 24D1-dev 2024-04-26 07:47:12 +00:00
Peter (YM)
b76a852082 thermal: use frequency to define hard limit and cdev ceiling
Test: Boot to home and flash on device
Bug: 330780045
Change-Id: I6deaa4de72d289468344c3312ac44e266e225883
Signed-off-by: Peter (YM) <peterym@google.com>
2024-04-26 04:02:25 +00:00
sashwinbalaji
607d6b55a3 thermal: Add VSkin-Speaker Model
- Add linear regression model for VSkin-Speaker
- Setup abnormality monitoring:
	- 0 <= VSkin-Speaker <= 55
	- -15 <= Vskin-Speaker Model - Legacy <= 15
- Residency for Vskin-Speaker Model

Bug: 303547367
Test: Local build and verify lshal
Change-Id: Iadb46c82c2568c2eec31fe2cf7b9fd2cb9a56a04
2024-04-24 14:54:31 +08:00
sashwinbalaji
be09cda8ba thermal: Update VSkin-Model
- Unhide VSkin-Model to ensure thermal recorder can log
- Reduce vskin-model-legacy-diff to align with other devices
- Remove model backupsensor, since model is not used for throttling
  remove backup sensor to collect more field issues.

Bug: 315948438
Test: Push config and verify dumpsys
Change-Id: I4adfcb6a13c58b15f1d97b1130d4bc0f1776f235
2024-04-24 14:00:21 +08:00
sashwinbalaji
2c94505351 thermal: read 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.

Current Issue:
We are observing lot of extreme low temp for vskin being reported and
with all coefficients being positive the only way negative vskin is
reported is when thermistors report very low temp. Since abnormality
logging is rate limited this reduces the amount of ml model issues
reported.

Bug: 323987378
Test: Local build and verify lshal
Change-Id: I2445f9d654c2a86c9507bf1654dc44f3b765c889
2024-04-19 09:49:15 +08:00
TeYuan Wang
d51b20059e thermal: adjust CPU cdev_ceiling
Bug: 329697728
Test: boot to home
Change-Id: I0df4438f17832c7f121cc4340064855d44a44a2b
2024-04-16 18:52:29 +00:00
Treehugger Robot
acdce4976a Merge "thermal: Add VIRTUAL-SKIN-MODEL" into 24D1-dev 2024-04-09 00:39:19 +00:00
Treehugger Robot
ce7f4875bc Merge "thermal: Update left/right inner display equations" into 24D1-dev 2024-04-08 22:38:45 +00:00
sashwinbalaji
7ac59e36d9 thermal: Hide USB-MINUS-CHARGER
Hide the subsensor USB-MINUS-CHARGER.

Bug: 303547449
Test: Local build, verify no thermal error logs and lshal.
Change-Id: Ia3b09b6c33191fde861c3861d5d159be285a200a
2024-04-08 20:27:50 +00:00
sashwinbalaji
8255f9834c thermal: Add VIRTUAL-SKIN-MODEL
- Add vskin-model.
- Rename existing vskin to vskin-legacy.
- Add input validation for model and fallback on vskin-legacy for
  vskin-model.
- Add abnormality and residency stats for vskin model.

Bug: 315948438
Test: Local build and verify lshal and thermal logcat.
Change-Id: I3930939b9ed3777ed6eb5bce745c9f099f639fb1
2024-04-08 10:52:19 +08:00
sashwinbalaji
c5642a252a thermal: Update left/right inner display equations
Update the formula for L/R brightness compensation.

Bug: 309716793
Test: Load config and veirfy thermal log and lshal
Change-Id: I33c0054b19197b4fa7f298090d6b2c2acb1f076f
2024-04-08 10:52:19 +08:00
sashwinbalaji
2d2f84936d 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:42:56 +08:00
sashwinbalaji
809257b65d thermal: Update charging equation and threshold.
- Update WLC moderate threshold from 38 to 41.
- Update rule to identify WLC scneario (acc to pa/2736243).
- Update WLC equation to latest equation.
- Keep inital vskin-charge equation as vskin-charge persist.
- lower charger_threm trigger point to align with vskin-charge persist
  trigger temp.
- Set vskin-charge-persist as vskin-wlc if current state is wlc else set
  to vskin-wired.
- to ensure vskin wired status is recorded, unhide is_wlc, vskin-wired
  and vskin-charge-persist.

Bug: 303547723
Test: Boot to home and check logs
Change-Id: I1b86b3c15caca6353447c76f2f72bb7c18cccfd6
2024-03-28 16:07:32 +08:00
sashwinbalaji
80c9fb7020 thermal: Update VIRTUAL-SKIN equation
Update the trigger sensors and equation for virtual-skin.

Bug: 303547449
Test: Local build, verify no thermal error logs and lshal.
Change-Id: I72677b58a4c4e29f4cd5e95b98691e4e1efb0fdc
2024-03-28 15:30:36 +08:00
Treehugger Robot
474b0138cc Merge "thermal: update cdev ceiling for LITTLE cores" into 24D1-dev 2024-03-26 18:53:49 +00:00
sashwinbalaji
e1a6516a88 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: 331397497
Test: Build and boot on device.
Change-Id: I770b4495715a8da8e90248c0df043d2aa489c8d4
2024-03-26 16:48:05 +00:00
Peter (YM)
2e3b405b8a 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: Build and verify behavior by sending powerhint
Change-Id: Ida42089c9752ce03875da9f390cc6d4a360151d8
Signed-off-by: Peter (YM) <peterym@google.com>
2024-03-26 07:14:03 +00:00
sashwinbalaji
ab5065e8a5 thermal: Add initial VIRTUAL-SKIN-OUTER-DISPLAY
To monitor and verify the feature of "sensor name based brightness
throttling", add VIRTUAL-SKIN-OUTER-DISPLAY of type DISPLAY.

But to ensure no regression, set its equation to be same as VIRTUAL-SKIN
and in future once verified we can update the equation.

Bug: 326615866
Test: Local build and verify thermal logs
Change-Id: I370990837911ab4b733aa9adca624ff1788f9500
2024-02-26 18:37:22 +08:00
sashwinbalaji
259d71f4d3 thermal: Update hotThresholds
Update emergency and shutdown threshold values to align with previous
generation foldable device.

Bug: 303547512
Bug: 322147413

Test: Build and verify lshal and use emul_temp to trigger shutdown
Change-Id: I3229de36dafcff7fdb29a6f1dd014bd49324c285
2024-02-22 08:28:57 +08:00
Priyanka Advani
c12fbfbd41 Revert "thermal: Update hotThresholds"
This reverts commit fb839117d6.

Reason for revert: Probable culprit for b/326235335. Will be verifying through ABTD for confirmation and before submitting the revert.

Change-Id: Ie82a56007090386c5f4425b3495fc8ccfdfc884c
2024-02-21 16:52:33 +00:00
sashwinbalaji
fb839117d6 thermal: Update hotThresholds
Update emergency and shutdown threshold values to align with previous
generation foldable device.

Bug: 303547512
Bug: 322147413

Test: Build and verify lshal and use emul_temp to trigger shutdown
Change-Id: Ia98dc74d5964868fa893ef1badfe0f5e37093e40
2024-02-21 18:25:04 +08:00
Peter (YM)
2f23a1f721 thermal: update gpu cdev ceiling
To Align with latest GPU available frquencies

Bug: 318313844
Test: run gpu stress test
Change-Id: I5260ee09877f9e4167535baa09ebc8d091587007
Signed-off-by: Peter (YM) <peterym@google.com>
2024-02-06 06:39:19 +00:00