Skip to content

fix(asusd): apply PPT limits on set even without ppt_enabled attribute#150

Open
IoriAkatsuki wants to merge 1 commit into
OpenGamingCollective:mainfrom
IoriAkatsuki:fix-ppt-tuning-silent-discard
Open

fix(asusd): apply PPT limits on set even without ppt_enabled attribute#150
IoriAkatsuki wants to merge 1 commit into
OpenGamingCollective:mainfrom
IoriAkatsuki:fix-ppt-tuning-silent-discard

Conversation

@IoriAkatsuki

Copy link
Copy Markdown

What

Fixes PPT (ppt_pl1_spl / ppt_pl2_sppt) writes being silently discarded on kernels without a ppt_enabled firmware attribute. Fixes #149.

Why

set_current_value gates PPT sysfs writes on the per-profile Tuning.enabled flag, but nothing sets that flag to true when the ppt_enabled attribute is absent (it is never registered because the sysfs node does not exist). Result: tuning can never be enabled, PPT writes are always skipped, and the current_value getter returns the cached config value — so get / the GUI report success while the hardware limit is unchanged.

Changes (asusd/src/asus_armoury.rs)

  • set_current_value (Ppt): auto-enable the profile's tuning group on an explicit set, so the value is actually written to hardware. This is the only sensible enable path when ppt_enabled is unavailable.
  • current_value (Ppt): read the real value from sysfs instead of the cached config value, so tools report the true state.

Testing

On G634JZ (i9-13980HX), kernel 7.1.2, asus-armoury without ppt_enabled:

  • Before: asusctl armoury set ppt_pl1_spl 65 → sysfs stays 140.
  • After: same command → ppt_pl1_spl/current_value == 65; switching profiles now applies per-profile PPT (Quiet 65/95, Balanced 100/120, Performance 140/175), verified by reading the sysfs node directly.
  • cargo build --release -p asusd clean.

Open question

Auto-enabling on an explicit set slightly changes semantics for setups where ppt_enabled does exist (there the GUI toggle stays authoritative and can still disable afterward). Happy to gate this behind "only when no ppt_enabled attribute is present" if you prefer a more conservative fix.

PPT (ppt_pl1_spl/ppt_pl2_sppt) writes were silently discarded on kernels
where asus-armoury does not expose a `ppt_enabled` firmware attribute.
The per-profile Tuning.enabled flag gates whether PPT values are written
to sysfs, but nothing ever sets it to true when ppt_enabled is absent, so
tuning could never be enabled and every set was skipped. The PPT
current_value getter also returned the cached config value instead of the
real sysfs value, masking the failure (get reports success, hardware
unchanged).

- set_current_value: auto-enable the profile's tuning on an explicit PPT
  set so the value is actually written to hardware.
- current_value: read the real value from sysfs instead of the cache.
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.

PPT (TDP) limits set via asusctl are silently discarded on kernels without ppt_enabled

1 participant