Skip to content

thermald: adaptive: Handle NotifyPlatform targets - #613

Open
boyakhil978 wants to merge 1 commit into
intel:masterfrom
boyakhil978:notify-platform-imok
Open

boyakhil978 wants to merge 1 commit into
intel:masterfrom
boyakhil978:notify-platform-imok

Conversation

@boyakhil978

Copy link
Copy Markdown

Adaptive tables can contain NotifyPlatform targets on the IETM participant. The Windows DTT stack passes the argument to the firmware through IETM.IMOK, so the firmware learns which adaptive target is active. thermald currently drops these targets (cdev IETM not found in the log).

The int3400 driver already exposes IMOK as the write-only imok sysfs attribute, so this change writes the target's argument there.

Why it matters

HP uses IMOK to set the EC's cooling mode. On the HP Spectre x360 14 (board 8C15, Meteor Lake), IMOK maps its argument to the EC field HPCM. The GDDV adaptive table has NotifyPlatform targets for every mode, including ones the BIOS profile switch never sets (In_bag_1, U_CS_Com_*, U_CS_Q1).

Testing (board 8C15)

  • The EC was put in Cool mode by hand (echo 7 > imok, HPCM 0x02) with the BIOS profile on Balanced. The patched thermald then selects U_CS_B_A, logs NotifyPlatform 5, and HPCM returns to 0x01.
  • In a separate 20-minute CPU+GPU load test in Performance on AC, the adaptive engine (2.5.13, before this change) selected U_CS_P_A and held SEN2 at or below 58 °C. Without adaptive mode, this laptop's EC powers it off after ~10 s at SEN2 ≥ 68 °C.

Related kernel fix, sent to platform-driver-x86: hp-wmi now masks the thermal profile query to its low byte. Without it, reading platform_profile returns -EINVAL on this board because the firmware packs flags and posture into the upper bytes.

🤖 Generated with Claude Code

@spandruvada
spandruvada requested a balanced review from Copilot October 27, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

2 open issues
What changed in this PR

Adds support for Adaptive NotifyPlatform targets by writing the target argument to the int3400 imok sysfs attribute, allowing firmware/EC to learn the currently active adaptive target.

Changes:

  • Add set_notify_platform() helper to handle NotifyPlatform adaptive targets.
  • Update adaptive target execution to dispatch NotifyPlatform targets to the new helper.
  • Parse the target argument and write it to ${int3400_base_path}imok with logging on failures.
File Description
src/​thd_engine_adaptive.h Declares the new set_notify_platform() helper for adaptive target execution.
src/​thd_engine_adaptive.cpp Implements NotifyPlatform handling by parsing the argument and writing it to imok, and adds dispatch logic in execute_target().

Review effort: Lite

Comment thread src/thd_engine_adaptive.cpp Resolved
Comment thread src/thd_engine_adaptive.cpp Resolved
Adaptive tables can contain NotifyPlatform targets on the IETM
participant. The Windows DTT stack passes the argument to the firmware
through IETM.IMOK, so the firmware learns which adaptive target is
active. thermald drops them today ("cdev IETM not found").

HP uses this to set the EC's cooling mode. On the HP Spectre x360 14
(board 8C15), IMOK maps the argument to EC field HPCM, and the table
has NotifyPlatform targets for every mode, including ones (In_bag_1,
U_CS_Com_*, U_CS_Q1) that the BIOS's own profile switch never sets.

The int3400 driver already exposes IMOK as the write-only "imok"
attribute. Write the argument there.

Tested on board 8C15: with the EC put in Cool mode via imok (HPCM
0x02) and the BIOS profile on Balanced, thermald selects U_CS_B_A,
logs "NotifyPlatform 5" and the EC's HPCM returns to 0x01. Under 20
minutes of CPU+GPU load in Performance on AC, the adaptive engine
(2.5.13, before this change) holds SEN2 at or below 58C.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Akhil Boyapati <boyakhil978@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants