From: Antheas Kapenekakis <lkml@antheas.dev>
To: dmitry.osipenko@collabora.com
Cc: bob.beckett@collabora.com, bookeldor@gmail.com,
hadess@hadess.net, jaap@haitsma.org, kernel@collabora.com,
lennart@poettering.net, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, lkml@antheas.dev, mccann@jhu.edu,
rafael@kernel.org, richard@hughsie.com,
sebastian.reichel@collabora.com, superm1@kernel.org,
systemd-devel@lists.freedesktop.org, xaver.hugl@gmail.com
Subject: [RFC v2 06/10] platform/x86: asus-wmi: Remove Ally s2idle resume fixes
Date: Sat, 25 Apr 2026 23:57:30 +0200 [thread overview]
Message-ID: <20260425215734.14116-7-lkml@antheas.dev> (raw)
In-Reply-To: <20260425215734.14116-1-lkml@antheas.dev>
Ally device controllers had suspend issues due to the faulty s2idle
ordering present in the kernel, causing a failure to resume. These
issues were partially addressed with a firmware update, leading to
the introduction of a version check in hid-asus and accompanying calls
in this driver.
However, after fixing the call ordering in s2idle and adding a small
delay particularly for Ally devices, the controller for these devices
is universally fixed for all firmware versions, including the spurious
resume bug requiring set_ally_mcu_powersave(True) for the controller to
function correctly on newer firmwares.
Therefore, remove the calls, suspend quirks with CSEE duplicate calling
(it was always called by s2idle through the Display Off _DSM but ignored
while the USB subsystem was down and these calls took place), and
cleanup the driver.
Noteworthy is that we no longer force mcu_powersave to be on boot. This
way, the user's choice in e.g. Windows or from userspace software is
respected. Downstream distributions that care about the additional power
draw in lieu of the significant additional delay in resume introduced by
the setting can enable it with a udev rule (the canonical handling for
this functionality).
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
---
drivers/platform/x86/asus-wmi.c | 124 ---------------------
include/linux/platform_data/x86/asus-wmi.h | 8 --
2 files changed, 132 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 3316415abbdf..70c725ca0edd 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -140,33 +140,10 @@ module_param(fnlock_default, bool, 0444);
#define ASUS_MINI_LED_2024_STRONG 0x01
#define ASUS_MINI_LED_2024_OFF 0x02
-#define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE"
-/*
- * The period required to wait after screen off/on/s2idle.check in MS.
- * Time here greatly impacts the wake behaviour. Used in suspend/wake.
- */
-#define ASUS_USB0_PWR_EC0_CSEE_WAIT 600
-#define ASUS_USB0_PWR_EC0_CSEE_OFF 0xB7
-#define ASUS_USB0_PWR_EC0_CSEE_ON 0xB8
-
static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
static int throttle_thermal_policy_write(struct asus_wmi *);
-static const struct dmi_system_id asus_rog_ally_device[] = {
- {
- .matches = {
- DMI_MATCH(DMI_BOARD_NAME, "RC71L"),
- },
- },
- {
- .matches = {
- DMI_MATCH(DMI_BOARD_NAME, "RC72L"),
- },
- },
- { },
-};
-
static bool ashs_present(void)
{
int i = 0;
@@ -341,9 +318,6 @@ struct asus_wmi {
struct acpi_s2idle_dev_ops s2idle_dev_ops;
};
-/* Global to allow setting externally without requiring driver data */
-static enum asus_ally_mcu_hack use_ally_mcu_hack = ASUS_WMI_ALLY_MCU_HACK_INIT;
-
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
static void asus_wmi_show_deprecated(void)
{
@@ -1436,43 +1410,6 @@ static DEVICE_ATTR_RW(nv_temp_target);
/* Ally MCU Powersave ********************************************************/
-/*
- * The HID driver needs to check MCU version and set this to false if the MCU FW
- * version is >= the minimum requirements. New FW do not need the hacks.
- */
-void set_ally_mcu_hack(enum asus_ally_mcu_hack status)
-{
- use_ally_mcu_hack = status;
- pr_debug("%s Ally MCU suspend quirk\n",
- status == ASUS_WMI_ALLY_MCU_HACK_ENABLED ? "Enabled" : "Disabled");
-}
-EXPORT_SYMBOL_NS_GPL(set_ally_mcu_hack, "ASUS_WMI");
-
-/*
- * mcu_powersave should be enabled always, as it is fixed in MCU FW versions:
- * - v313 for Ally X
- * - v319 for Ally 1
- * The HID driver checks MCU versions and so should set this if requirements match
- */
-void set_ally_mcu_powersave(bool enabled)
-{
- int result, err;
-
- err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, enabled, &result);
- if (err) {
- pr_warn("Failed to set MCU powersave: %d\n", err);
- return;
- }
- if (result > 1) {
- pr_warn("Failed to set MCU powersave (result): 0x%x\n", result);
- return;
- }
-
- pr_debug("%s MCU Powersave\n",
- enabled ? "Enabled" : "Disabled");
-}
-EXPORT_SYMBOL_NS_GPL(set_ally_mcu_powersave, "ASUS_WMI");
-
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
static ssize_t mcu_powersave_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -5038,21 +4975,6 @@ static int asus_wmi_add(struct platform_device *pdev)
acpi_register_lps0_dev(&asus->s2idle_dev_ops);
}
- if (use_ally_mcu_hack == ASUS_WMI_ALLY_MCU_HACK_INIT) {
- if (acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE)
- && dmi_check_system(asus_rog_ally_device))
- use_ally_mcu_hack = ASUS_WMI_ALLY_MCU_HACK_ENABLED;
- if (dmi_match(DMI_BOARD_NAME, "RC71")) {
- /*
- * These steps ensure the device is in a valid good state, this is
- * especially important for the Ally 1 after a reboot.
- */
- acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE,
- ASUS_USB0_PWR_EC0_CSEE_ON);
- msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
- }
- }
-
/* ensure defaults for tunables */
#if IS_ENABLED(CONFIG_ASUS_WMI_DEPRECATED_ATTRS)
asus->ppt_pl2_sppt = 5;
@@ -5306,51 +5228,10 @@ static int asus_hotk_restore(struct device *device)
return 0;
}
-static int asus_hotk_prepare(struct device *device)
-{
- if (use_ally_mcu_hack == ASUS_WMI_ALLY_MCU_HACK_ENABLED) {
- acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE,
- ASUS_USB0_PWR_EC0_CSEE_OFF);
- msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
- }
- return 0;
-}
-
-#if defined(CONFIG_SUSPEND)
-static void asus_ally_s2idle_restore(void)
-{
- if (use_ally_mcu_hack == ASUS_WMI_ALLY_MCU_HACK_ENABLED) {
- acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE,
- ASUS_USB0_PWR_EC0_CSEE_ON);
- msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
- }
-}
-
-/* Use only for Ally devices due to the wake_on_ac */
-static struct acpi_s2idle_dev_ops asus_ally_s2idle_dev_ops = {
- .restore = asus_ally_s2idle_restore,
-};
-
-static void asus_s2idle_check_register(void)
-{
- if (acpi_register_lps0_dev(&asus_ally_s2idle_dev_ops))
- pr_warn("failed to register LPS0 sleep handler in asus-wmi\n");
-}
-
-static void asus_s2idle_check_unregister(void)
-{
- acpi_unregister_lps0_dev(&asus_ally_s2idle_dev_ops);
-}
-#else
-static void asus_s2idle_check_register(void) {}
-static void asus_s2idle_check_unregister(void) {}
-#endif /* CONFIG_SUSPEND */
-
static const struct dev_pm_ops asus_pm_ops = {
.thaw = asus_hotk_thaw,
.restore = asus_hotk_restore,
.resume = asus_hotk_resume,
- .prepare = asus_hotk_prepare,
};
/* Registration ***************************************************************/
@@ -5377,11 +5258,7 @@ static int asus_wmi_probe(struct platform_device *pdev)
return ret;
}
- asus_s2idle_check_register();
-
ret = asus_wmi_add(pdev);
- if (ret)
- asus_s2idle_check_unregister();
return ret;
}
@@ -5418,7 +5295,6 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver);
void asus_wmi_unregister_driver(struct asus_wmi_driver *driver)
{
guard(mutex)(®ister_mutex);
- asus_s2idle_check_unregister();
platform_device_unregister(driver->platform_device);
platform_driver_unregister(&driver->platform_driver);
diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h
index 554f41b827e1..938a27c6f66e 100644
--- a/include/linux/platform_data/x86/asus-wmi.h
+++ b/include/linux/platform_data/x86/asus-wmi.h
@@ -188,8 +188,6 @@ enum asus_hid_event {
#define ASUS_EV_MAX_BRIGHTNESS 3
#if IS_REACHABLE(CONFIG_ASUS_WMI)
-void set_ally_mcu_hack(enum asus_ally_mcu_hack status);
-void set_ally_mcu_powersave(bool enabled);
int asus_wmi_get_devstate_dsts(u32 dev_id, u32 *retval);
int asus_wmi_set_devstate(u32 dev_id, u32 ctrl_param, u32 *retval);
int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, u32 *retval);
@@ -197,12 +195,6 @@ int asus_hid_register_listener(struct asus_hid_listener *cdev);
void asus_hid_unregister_listener(struct asus_hid_listener *cdev);
int asus_hid_event(enum asus_hid_event event);
#else
-static inline void set_ally_mcu_hack(enum asus_ally_mcu_hack status)
-{
-}
-static inline void set_ally_mcu_powersave(bool enabled)
-{
-}
static inline int asus_wmi_set_devstate(u32 dev_id, u32 ctrl_param, u32 *retval)
{
return -ENODEV;
--
2.53.0
next prev parent reply other threads:[~2026-04-25 21:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 21:57 [RFC v2 00/10] acpi/x86: s2idle: Introduce and implement hint class ABI and idle hint for s2idle Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 01/10] acpi/x86: s2idle: Rename LPS0 constants so they mirror their function Antheas Kapenekakis
2026-04-26 14:14 ` Rafael J. Wysocki
2026-04-26 16:54 ` Antheas Kapenekakis
2026-04-27 15:07 ` Rafael J. Wysocki
2026-04-25 21:57 ` [RFC v2 02/10] acpi/x86: s2idle: Move Modern Standby calls to s2idle begin/end Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 03/10] acpi/x86: s2idle: Add support for adding a delay after begin MS calls Antheas Kapenekakis
2026-04-28 1:57 ` Mario Limonciello
2026-04-28 7:47 ` Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 04/10] platform/x86: asus-wmi: add s2idle begin delay for Ally devices Antheas Kapenekakis
2026-04-28 1:56 ` Mario Limonciello
2026-04-28 6:34 ` [systemd-devel] " Paul Menzel
2026-04-28 8:18 ` Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 05/10] HID: asus: remove quirk handling " Antheas Kapenekakis
2026-04-25 21:57 ` Antheas Kapenekakis [this message]
2026-04-25 21:57 ` [RFC v2 07/10] Documentation: Add documentation for the new sysfs hints class Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 08/10] hint: Add hint class ABI for devices to receive updates on host activity Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 09/10] acpi/x86: s2idle: Listen to idle hints to perform MS transitions Antheas Kapenekakis
2026-04-25 21:57 ` [RFC v2 10/10] acpi/x86: s2idle: Subtract delay from last DSM fire in begin delay Antheas Kapenekakis
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=20260425215734.14116-7-lkml@antheas.dev \
--to=lkml@antheas.dev \
--cc=bob.beckett@collabora.com \
--cc=bookeldor@gmail.com \
--cc=dmitry.osipenko@collabora.com \
--cc=hadess@hadess.net \
--cc=jaap@haitsma.org \
--cc=kernel@collabora.com \
--cc=lennart@poettering.net \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mccann@jhu.edu \
--cc=rafael@kernel.org \
--cc=richard@hughsie.com \
--cc=sebastian.reichel@collabora.com \
--cc=superm1@kernel.org \
--cc=systemd-devel@lists.freedesktop.org \
--cc=xaver.hugl@gmail.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