mbox series

[v3,0/2] hid-asus: asus-wmi: refactor Ally suspend/resume

Message ID 20250321035106.26752-1-luke@ljones.dev (mailing list archive)
Headers show
Series hid-asus: asus-wmi: refactor Ally suspend/resume | expand

Message

Luke D. Jones March 21, 2025, 3:51 a.m. UTC
This short series refactors the Ally suspend/resume functionality in the
asus-wmi driver along with adding support for ROG Ally MCU version checking.

The version checking is then used to toggle the use of older CSEE call hacks
that were initially used to combat Ally suspend/wake issues arising from the MCU
not clearing a particular flag on resume. ASUS have since corrected this
especially for Linux in newer firmware versions.

- hid-asus requests the MCU version and displays a warning if the version is
  older than the one that fixes the issue.
- hid-asus awill also toggle the CSEE hack off, and mcu_powersave to on if the
version is high enough.

- Changelog:
  + V2:
    - Adjust warning message to explicitly mention suspend issues
    - Use switch/case block to set min_version
      - Set min_version to 0 by default and toggle hacks off
  + V3:
    - Fix errors picked up by test bot: incorrect return in the else block
      of `#if IS_REACHABLE(CONFIG_ASUS_WMI)`:
      - set_ally_mcu_hack()
      - set_ally_mcu_powersave()

Luke D. Jones (2):
  hid-asus: check ROG Ally MCU version and warn
  platform/x86: asus-wmi: Refactor Ally suspend/resume

 drivers/hid/hid-asus.c                     | 111 +++++++++++++++++-
 drivers/platform/x86/asus-wmi.c            | 130 ++++++++++++++-------
 include/linux/platform_data/x86/asus-wmi.h |  13 +++
 3 files changed, 213 insertions(+), 41 deletions(-)

Comments

Luke D. Jones March 21, 2025, 3:53 a.m. UTC | #1
On 21/03/25 16:51, Luke Jones wrote:
> This short series refactors the Ally suspend/resume functionality in the
> asus-wmi driver along with adding support for ROG Ally MCU version checking.
> 
> The version checking is then used to toggle the use of older CSEE call hacks
> that were initially used to combat Ally suspend/wake issues arising from the MCU
> not clearing a particular flag on resume. ASUS have since corrected this
> especially for Linux in newer firmware versions.
> 
> - hid-asus requests the MCU version and displays a warning if the version is
>    older than the one that fixes the issue.
> - hid-asus awill also toggle the CSEE hack off, and mcu_powersave to on if the
> version is high enough.

It is *strongly* preferred to remove the hack completely, but this may 
take some time after this series lands for it to be viable without 
regressing users.

I thought I had added to above to cover-letter but did not, sorry all.

The aim is to remove the hack at some stage this year.

> - Changelog:
>    + V2:
>      - Adjust warning message to explicitly mention suspend issues
>      - Use switch/case block to set min_version
>        - Set min_version to 0 by default and toggle hacks off
>    + V3:
>      - Fix errors picked up by test bot: incorrect return in the else block
>        of `#if IS_REACHABLE(CONFIG_ASUS_WMI)`:
>        - set_ally_mcu_hack()
>        - set_ally_mcu_powersave()
> 
> Luke D. Jones (2):
>    hid-asus: check ROG Ally MCU version and warn
>    platform/x86: asus-wmi: Refactor Ally suspend/resume
> 
>   drivers/hid/hid-asus.c                     | 111 +++++++++++++++++-
>   drivers/platform/x86/asus-wmi.c            | 130 ++++++++++++++-------
>   include/linux/platform_data/x86/asus-wmi.h |  13 +++
>   3 files changed, 213 insertions(+), 41 deletions(-)
>
Antheas Kapenekakis March 21, 2025, 5:39 p.m. UTC | #2
On Fri, 21 Mar 2025 at 04:51, Luke Jones <luke@ljones.dev> wrote:
>
> This short series refactors the Ally suspend/resume functionality in the
> asus-wmi driver along with adding support for ROG Ally MCU version checking.
>
> The version checking is then used to toggle the use of older CSEE call hacks
> that were initially used to combat Ally suspend/wake issues arising from the MCU
> not clearing a particular flag on resume. ASUS have since corrected this
> especially for Linux in newer firmware versions.
>
> - hid-asus requests the MCU version and displays a warning if the version is
>   older than the one that fixes the issue.
> - hid-asus awill also toggle the CSEE hack off, and mcu_powersave to on if the
> version is high enough.
>
> - Changelog:
>   + V2:
>     - Adjust warning message to explicitly mention suspend issues
>     - Use switch/case block to set min_version
>       - Set min_version to 0 by default and toggle hacks off
>   + V3:
>     - Fix errors picked up by test bot: incorrect return in the else block
>       of `#if IS_REACHABLE(CONFIG_ASUS_WMI)`:
>       - set_ally_mcu_hack()
>       - set_ally_mcu_powersave()
>
> Luke D. Jones (2):
>   hid-asus: check ROG Ally MCU version and warn
>   platform/x86: asus-wmi: Refactor Ally suspend/resume
>
>  drivers/hid/hid-asus.c                     | 111 +++++++++++++++++-
>  drivers/platform/x86/asus-wmi.c            | 130 ++++++++++++++-------
>  include/linux/platform_data/x86/asus-wmi.h |  13 +++
>  3 files changed, 213 insertions(+), 41 deletions(-)
>
> --
> 2.49.0
>

Since I have to also test my series on my ally and booted a dev
environment, I am also giving this a go. I'll post some results in a
bit

Antheas