Skip to content

Commit 5c8183d

Browse files
committed
[FROM-ML] platform/x86: asus-armoury: expose requires_fan_curve via sysfs
1 parent 53fc73b commit 5c8183d

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

Documentation/ABI/testing/sysfs-class-firmware-attributes

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,3 +492,28 @@ Description:
492492
log entry size identifies audit log size for the current BIOS version.
493493
The current size is 16 bytes but it can be up to 128 bytes long in future BIOS
494494
versions.
495+
496+
What: /sys/class/firmware-attributes/asus-armoury/attributes/requires_fan_curve
497+
Date: May 2026
498+
KernelVersion: 7.1
499+
Contact: platform-driver-x86@vger.kernel.org
500+
Description:
501+
A read-only attribute that reads 1 on ASUS ROG models where the
502+
BIOS requires a custom fan curve to be active before Package
503+
Power Tracking (PPT) writes take effect. On affected models, the
504+
BIOS silently ignores writes to ppt_pl1_spl, ppt_pl2_sppt,
505+
ppt_pl3_fppt, ppt_apu_sppt and ppt_platform_sppt unless a custom
506+
fan curve has been written via the asus_custom_fan_curve hwmon
507+
device.
508+
509+
The kernel rejects PPT writes with -EBUSY on these models when
510+
no fan curve is active. Userspace tools can read this attribute
511+
to surface a clear prerequisite to the user instead of letting
512+
the write appear to succeed at the firmware-attribute layer
513+
while the BIOS discards it.
514+
515+
== ==============================================
516+
0 No fan curve prerequisite for PPT writes.
517+
1 A custom fan curve must be active; PPT writes
518+
return -EBUSY otherwise.
519+
== ==============================================

drivers/platform/x86/asus-armoury.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ static ssize_t pending_reboot_show(struct kobject *kobj, struct kobj_attribute *
127127

128128
static struct kobj_attribute pending_reboot = __ATTR_RO(pending_reboot);
129129

130+
static ssize_t requires_fan_curve_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
131+
{
132+
return sysfs_emit(buf, "%d\n", asus_armoury.requires_fan_curve);
133+
}
134+
135+
static struct kobj_attribute requires_fan_curve = __ATTR_RO(requires_fan_curve);
136+
130137
static bool asus_bios_requires_reboot(struct kobj_attribute *attr)
131138
{
132139
return !strcmp(attr->attr.name, "gpu_mux_mode") ||
@@ -914,6 +921,12 @@ static int asus_fw_attr_add(void)
914921
goto err_destroy_kset;
915922
}
916923

924+
err = sysfs_create_file(&asus_armoury.fw_attr_kset->kobj, &requires_fan_curve.attr);
925+
if (err) {
926+
pr_err("Failed to create requires_fan_curve attribute\n");
927+
goto err_destroy_kset;
928+
}
929+
917930
asus_armoury.mini_led_dev_id = 0;
918931
if (armoury_has_devstate(ASUS_WMI_DEVID_MINI_LED_MODE))
919932
asus_armoury.mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE;
@@ -987,6 +1000,7 @@ static int asus_fw_attr_add(void)
9871000
if (asus_armoury.mini_led_dev_id)
9881001
sysfs_remove_group(&asus_armoury.fw_attr_kset->kobj, &mini_led_mode_attr_group);
9891002
err_remove_file:
1003+
sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &requires_fan_curve.attr);
9901004
sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &pending_reboot.attr);
9911005
err_destroy_kset:
9921006
kset_unregister(asus_armoury.fw_attr_kset);
@@ -1161,6 +1175,7 @@ static void __exit asus_fw_exit(void)
11611175
if (asus_armoury.mini_led_dev_id)
11621176
sysfs_remove_group(&asus_armoury.fw_attr_kset->kobj, &mini_led_mode_attr_group);
11631177

1178+
sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &requires_fan_curve.attr);
11641179
sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &pending_reboot.attr);
11651180
kset_unregister(asus_armoury.fw_attr_kset);
11661181
device_destroy(&firmware_attributes_class, MKDEV(0, 0));

0 commit comments

Comments
 (0)