Repository navigation
Conversation
The GDDV parser kept a single vscts_name and appended every VSCT and VSPT entry it found to the same two vectors. On platforms that define more than one virtual sensor participant, all of them were merged into one cthd_sensor_virtual named after the last one parsed, and the others never got a zone. Samsung Galaxy Book5 Pro 360 (NP960QHA, Lunar Lake) defines VR1.D0 and VR2.D0. Its "High" adaptive target, selected with the performance platform profile (Oem0 = 21), installs PSVT high_vr2, whose only entry targets VR1. With VR1 folded into VR2, install_passive() logs "Unable to find a zone for VR1", no zone is created, and thermald writes ignore_adaptive and exits, leaving the platform without adaptive control. Store VSCT and VSPT entries per participant in a vsensor list and create one virtual sensor and zone for each. A VSPT without a participant name still applies to sensors that have no polling table of their own, and a GDDV with a single virtual sensor produces the same sensor and zone as before. Signed-off-by: Scrimas <isma.ph@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
cthd_gddvkeeps a singlevscts_nameand appends every VSCT/VSPT entry it parses to the same two vectors. When a platform defines more than one virtual sensor participant, they are all merged into onecthd_sensor_virtualnamed after the last one parsed, and the other names never get a zone.On the Samsung Galaxy Book5 Pro 360 (NP960QHA, Core Ultra 7 256V / Lunar Lake, BIOS P17ALY.390.260616.03) the data vault defines two virtual sensors,
VR1.D0andVR2.D0. The "High" adaptive target (matched with theperformanceplatform profile,Oem0= 21) installs PSVThigh_vr2, whose only entry targetsVR1:With thermald 2.5.13,
thermald --adaptive --no-daemon --loglevel=debugonperformance:The "merged"
VR2sensor contains the targets of both participants (TCPU, SNS1, SNS2, SNS3 from VR1 plus SNS2 and the constant from VR2), and both polling tables. thermald then writesignore_adaptiveand exits. This CPU model is only supported in adaptive mode, so the restart leaves the machine with no thermald at all. Every other target on this platform (optimize,quiet,silent,tablet,inbag) uses SNS1 and works, so the failure only shows up on the performance profile, which TLP and power-profiles-daemon select on AC by default.Fix
vsensorlist (name,vscts,vspts), keyed by the participant name (VR1.D0,VR2.D0).install_virtual_sensor(). A sensor that fails to set up is skipped instead of stopping the remaining ones.vsct) is still applied to any virtual sensor without its own polling table. A data vault with a single virtual sensor produces the same sensor and zone as before.git diff -w: +98 / −39. The rest is re-indentation from moving the block into the new function.Testing
Same machine, kernel 7.2.8, patched build run from the build tree:
performanceprofile: ran the full 30 s, no exit, noignore_adaptive:balanced→performance→balancedwhile running (45 s): target switched Default/optimize→ High/high_vr2→ Default/optimize. No exit, and power limits were restored on exit.VR1.D0gets 4 VSCT targets plus its own VSPT (30/40/45 °C).VR2.D0gets 2 targets plus its own VSPT (17/24 °C).rapl_controller_mmio, plus a polling trip at 45 °C. No PSVT or condition on this platform references VR2, so its zone has no trip.performance(stress-ng --cpu 8, 280 s): PL1 held at 30 W (High's PL1MAX; it was 34 W before thermald), with the package at ~30 W, ~3.9 GHz and TCPU ~80 °C. VR1 as computed by thermald peaked at ~41 °C, so the 50 °C trip was not reached and I could not observe it firing. That trip and cooling device path is existing code that this change only makes reachable.makeandmake clang-tidyare clean for the changed lines.Not tested: a platform with a single virtual sensor (I don't have one). That path creates exactly one
vsensorentry and goes through the same calls as before.Attached:
samsung_np960qha_data_vault.zip: this machine's data vault, as the raw.binand as anod -x.hexfor theGDDV_LOAD_FROM_FILEtest loader.thermald-logs.zip: full--loglevel=debuglogs of each run above (stock 2.5.13 onperformance, patched onperformance, the profile-switch run, the stress-ng run, and its 5 s samples of temperatures, PL1, package power and clock).I prefer to be honest and disclose that this change was written with the help of an AI coding assistant (Claude). I reviewed it and tested it on the affected hardware as described above.
thermald-logs.zip
samsung_np960qha_data_vault.zip