[PATCH v3 0/1] asus-armoury: gate PPT writes on active fan curves

Ahmed Yaseen posted 1 patch 5 days, 6 hours ago
drivers/platform/x86/asus-armoury.c        | 20 ++++++++++++++++++
drivers/platform/x86/asus-wmi.c            | 24 ++++++++++++++++++++++
include/linux/platform_data/x86/asus-wmi.h |  5 +++++
3 files changed, 49 insertions(+)
[PATCH v3 0/1] asus-armoury: gate PPT writes on active fan curves
Posted by Ahmed Yaseen 5 days, 6 hours ago
My first kernel patch series, posted in agreement with Denis Benato (Cc'd).

On 30 ASUS ROG laptop models flagged with requires_fan_curve in the
asus-armoury DMI power_data table, the BIOS ACPI method SPLX silently
discards Package Power Tracking (PPT) writes unless the fan mode is
set to Manual (FANM=4). FANM is set to 4 by the DEFC method when a
custom fan curve is written. Until then, the WMI DEVS call returns
success but the firmware ignores the value, so userspace sees no
effect from writes to ppt_pl1_spl, ppt_pl2_sppt, ppt_pl3_fppt,
ppt_apu_sppt or ppt_platform_sppt.

The requires_fan_curve flag has existed in the per-model power_data
entries for some time but was never read. This patch wires it up:

  Patch 1: Adds the actual gate. Exports
    asus_wmi_custom_fan_curve_is_enabled() from asus-wmi so
    asus-armoury can query fan-curve state across module boundaries,
    and returns -EBUSY with a pr_warn_once() from the PPT write path on
    affected models when no fan curve is active.

Testing:
  Verified on G835LW (ROG Strix SCAR 18 2025, requires_fan_curve=true):
  - With no fan curve active, writes to ppt_pl1_spl return -EBUSY
    and the cached value is unchanged.
  - With pwm1_enable=1 on /sys/class/hwmon/.../asus_custom_fan_curve,
    PPT writes succeed and readback matches.
  - The pr_warn_once fires on the first rejected write and stays
    silent on subsequent ones, as expected.

  I do not have access to the other 29 affected models. Testers from
  any of these would be appreciated: FX507VI, FX507VV, FX507Z,
  GA402X, GA403UI, GA403UV, GA403WM, GA403WR, GA403WW, GA605W,
  GU605CR, GU605CW, GU605CX, GU605M, GU605MU, G513I, G513QM,
  G513QY, G513R, G614FP, G614J, G615LR, G634J, G713PV, G733C,
  G733P, G814J, G834J, G835LR.

Changes since v2:
  - Drop the new global asus_wmi_instance and reach the asus_wmi
    instance through the existing asus_ref reference (already shared
    with hid-asus), so it's accessed under its spinlock
  - Use pr_warn_once instead of pr_warn (Suggested by Mario Limonciello)
  - Drop the requires_fan_curve sysfs attribute (patch 2) so we're
    not locked into the ABI before a kernel-managed 'custom' platform
    profile design lands (Suggested by Derek J. Clark)

Changes since v1:
  - Return EBUSY instead of ENODEV for userspace clarity
    (Suggested by Derek J. Clark)
  - Update ABI Documents to reflect the change to EBUSY

Ahmed Yaseen (1):
  platform/x86: asus-armoury: gate PPT writes behind active fan curve

 drivers/platform/x86/asus-armoury.c        | 20 ++++++++++++++++++
 drivers/platform/x86/asus-wmi.c            | 24 ++++++++++++++++++++++
 include/linux/platform_data/x86/asus-wmi.h |  5 +++++
 3 files changed, 49 insertions(+)

-- 
2.54.0