From: Ahmed Yaseen <yaseen@ghoul.dev>
To: platform-driver-x86@vger.kernel.org
Cc: yaseen@ghoul.dev, corentin.chary@gmail.com, luke@ljones.dev,
denis.benato@linux.dev, derekjohn.clark@gmail.com,
hansg@kernel.org, ilpo.jarvinen@linux.intel.com,
prasanth.ksr@dell.com, mpearson-lenovo@squebb.ca,
Dell.Client.Kernel@dell.com, linux-kernel@vger.kernel.org,
asus-linux@lists.linux.dev
Subject: [PATCH 2/2] platform/x86: asus-armoury: expose requires_fan_curve via sysfs
Date: Mon, 11 May 2026 06:19:43 +0000 [thread overview]
Message-ID: <20260511061901.907540-3-yaseen@ghoul.dev> (raw)
In-Reply-To: <20260511061901.907540-1-yaseen@ghoul.dev>
Expose the per-model requires_fan_curve flag as a read-only sysfs
attribute so userspace tools (asusctl, rogcc) can discover whether
the system requires an active custom fan curve for PPT changes to
take effect, and warn the user before issuing such writes.
The attribute appears at:
/sys/class/firmware-attributes/asus-armoury/attributes/requires_fan_curve
Document the attribute in
Documentation/ABI/testing/sysfs-class-firmware-attributes.
Signed-off-by: Ahmed Yaseen <yaseen@ghoul.dev>
---
.../testing/sysfs-class-firmware-attributes | 25 +++++++++++++++++++
drivers/platform/x86/asus-armoury.c | 15 +++++++++++
2 files changed, 40 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-class-firmware-attributes b/Documentation/ABI/testing/sysfs-class-firmware-attributes
index 2713efa509b4..cff90c5840db 100644
--- a/Documentation/ABI/testing/sysfs-class-firmware-attributes
+++ b/Documentation/ABI/testing/sysfs-class-firmware-attributes
@@ -492,3 +492,28 @@ Description:
log entry size identifies audit log size for the current BIOS version.
The current size is 16 bytes but it can be up to 128 bytes long in future BIOS
versions.
+
+What: /sys/class/firmware-attributes/asus-armoury/attributes/requires_fan_curve
+Date: May 2026
+KernelVersion: 7.1
+Contact: platform-driver-x86@vger.kernel.org
+Description:
+ A read-only attribute that reads 1 on ASUS ROG models where the
+ BIOS requires a custom fan curve to be active before Package
+ Power Tracking (PPT) writes take effect. On affected models, the
+ BIOS silently ignores writes to ppt_pl1_spl, ppt_pl2_sppt,
+ ppt_pl3_fppt, ppt_apu_sppt and ppt_platform_sppt unless a custom
+ fan curve has been written via the asus_custom_fan_curve hwmon
+ device.
+
+ The kernel rejects PPT writes with -ENODEV on these models when
+ no fan curve is active. Userspace tools can read this attribute
+ to surface a clear prerequisite to the user instead of letting
+ the write appear to succeed at the firmware-attribute layer
+ while the BIOS discards it.
+
+ == ==============================================
+ 0 No fan curve prerequisite for PPT writes.
+ 1 A custom fan curve must be active; PPT writes
+ return -ENODEV otherwise.
+ == ==============================================
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index 01e552573674..fde6167c7f4e 100644
--- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c
@@ -127,6 +127,13 @@ static ssize_t pending_reboot_show(struct kobject *kobj, struct kobj_attribute *
static struct kobj_attribute pending_reboot = __ATTR_RO(pending_reboot);
+static ssize_t requires_fan_curve_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
+{
+ return sysfs_emit(buf, "%d\n", asus_armoury.requires_fan_curve);
+}
+
+static struct kobj_attribute requires_fan_curve = __ATTR_RO(requires_fan_curve);
+
static bool asus_bios_requires_reboot(struct kobj_attribute *attr)
{
return !strcmp(attr->attr.name, "gpu_mux_mode") ||
@@ -914,6 +921,12 @@ static int asus_fw_attr_add(void)
goto err_destroy_kset;
}
+ err = sysfs_create_file(&asus_armoury.fw_attr_kset->kobj, &requires_fan_curve.attr);
+ if (err) {
+ pr_err("Failed to create requires_fan_curve attribute\n");
+ goto err_destroy_kset;
+ }
+
asus_armoury.mini_led_dev_id = 0;
if (armoury_has_devstate(ASUS_WMI_DEVID_MINI_LED_MODE))
asus_armoury.mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE;
@@ -987,6 +1000,7 @@ static int asus_fw_attr_add(void)
if (asus_armoury.mini_led_dev_id)
sysfs_remove_group(&asus_armoury.fw_attr_kset->kobj, &mini_led_mode_attr_group);
err_remove_file:
+ sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &requires_fan_curve.attr);
sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &pending_reboot.attr);
err_destroy_kset:
kset_unregister(asus_armoury.fw_attr_kset);
@@ -1161,6 +1175,7 @@ static void __exit asus_fw_exit(void)
if (asus_armoury.mini_led_dev_id)
sysfs_remove_group(&asus_armoury.fw_attr_kset->kobj, &mini_led_mode_attr_group);
+ sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &requires_fan_curve.attr);
sysfs_remove_file(&asus_armoury.fw_attr_kset->kobj, &pending_reboot.attr);
kset_unregister(asus_armoury.fw_attr_kset);
device_destroy(&firmware_attributes_class, MKDEV(0, 0));
--
2.54.0
next prev parent reply other threads:[~2026-05-11 6:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 6:19 [PATCH 0/2] asus-armoury: gate PPT writes on active fan curves Ahmed Yaseen
2026-05-11 6:19 ` [PATCH 1/2] platform/x86: asus-armoury: gate PPT writes behind active fan curve Ahmed Yaseen
2026-05-12 15:15 ` Derek J. Clark
2026-05-11 6:19 ` Ahmed Yaseen [this message]
2026-05-12 15:14 ` [PATCH 0/2] asus-armoury: gate PPT writes on active fan curves Derek J. Clark
2026-05-13 14:54 ` Ahmed Yaseen
2026-05-19 16:05 ` Derek John Clark
2026-05-13 15:47 ` [PATCH v2 " Ahmed Yaseen
2026-05-13 15:47 ` [PATCH v2 1/2] platform/x86: asus-armoury: gate PPT writes behind active fan curve Ahmed Yaseen
2026-05-16 21:15 ` Mario Limonciello
2026-05-13 15:47 ` [PATCH v2 2/2] platform/x86: asus-armoury: expose requires_fan_curve via sysfs Ahmed Yaseen
2026-05-16 21:17 ` Mario Limonciello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260511061901.907540-3-yaseen@ghoul.dev \
--to=yaseen@ghoul.dev \
--cc=Dell.Client.Kernel@dell.com \
--cc=asus-linux@lists.linux.dev \
--cc=corentin.chary@gmail.com \
--cc=denis.benato@linux.dev \
--cc=derekjohn.clark@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luke@ljones.dev \
--cc=mpearson-lenovo@squebb.ca \
--cc=platform-driver-x86@vger.kernel.org \
--cc=prasanth.ksr@dell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®