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

Luke Jones posted 2 patches 9 months, 3 weeks ago
There is a newer version of this series
drivers/hid/hid-asus.c                     | 111 +++++++++++++++++-
drivers/platform/x86/asus-wmi.c            | 130 ++++++++++++++-------
include/linux/platform_data/x86/asus-wmi.h |  15 +++
3 files changed, 215 insertions(+), 41 deletions(-)
[PATCH v3 0/2] hid-asus: asus-wmi: refactor Ally suspend/resume
Posted by Luke Jones 9 months, 3 weeks ago
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.

*Note: In review it was requested by Mario that I try strsep() for parsing
the version. I did try this and a few variations but the result was much
more code due to having to check more edge cases due to the input being
raw bytes. In the end the cleaned up while loop proved more robust.

- Changelog:
  + V2: https://lore.kernel.org/platform-driver-x86/20250226010129.32043-1-luke@ljones.dev/T/#t
    - 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
    - Remove noise (excess pr_info)
    - Use kstrtoint, not kstrtolong
    - Use __free(kfree) for allocated mem and drop goto + logging
    - Use print_hex_dump() to show failed data after pr_err in mcu_request_version()
    - Use pr_debug in set_ally_mcu_hack() and set_ally_mcu_powersave() plus
      correct the message.

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 |  15 +++
 3 files changed, 215 insertions(+), 41 deletions(-)

-- 
2.48.1
Re: [PATCH v3 0/2] hid-asus: asus-wmi: refactor Ally suspend/resume
Posted by Jiri Kosina 9 months, 2 weeks ago
On Thu, 27 Feb 2025, 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.
> 
> *Note: In review it was requested by Mario that I try strsep() for parsing
> the version. I did try this and a few variations but the result was much
> more code due to having to check more edge cases due to the input being
> raw bytes. In the end the cleaned up while loop proved more robust.
> 
> - Changelog:
>   + V2: https://lore.kernel.org/platform-driver-x86/20250226010129.32043-1-luke@ljones.dev/T/#t
>     - 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
>     - Remove noise (excess pr_info)
>     - Use kstrtoint, not kstrtolong
>     - Use __free(kfree) for allocated mem and drop goto + logging
>     - Use print_hex_dump() to show failed data after pr_err in mcu_request_version()
>     - Use pr_debug in set_ally_mcu_hack() and set_ally_mcu_powersave() plus
>       correct the message.
> 
> 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 |  15 +++
>  3 files changed, 215 insertions(+), 41 deletions(-)

Hans, are you OK taking both patches through your tree?

Thanks,

-- 
Jiri Kosina
SUSE Labs
Re: [PATCH v3 0/2] hid-asus: asus-wmi: refactor Ally suspend/resume
Posted by Ilpo Järvinen 9 months, 2 weeks ago
On Tue, 4 Mar 2025, Jiri Kosina wrote:
> On Thu, 27 Feb 2025, 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.
> > 
> > *Note: In review it was requested by Mario that I try strsep() for parsing
> > the version. I did try this and a few variations but the result was much
> > more code due to having to check more edge cases due to the input being
> > raw bytes. In the end the cleaned up while loop proved more robust.
> > 
> > - Changelog:
> >   + V2: https://lore.kernel.org/platform-driver-x86/20250226010129.32043-1-luke@ljones.dev/T/#t
> >     - 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
> >     - Remove noise (excess pr_info)
> >     - Use kstrtoint, not kstrtolong
> >     - Use __free(kfree) for allocated mem and drop goto + logging
> >     - Use print_hex_dump() to show failed data after pr_err in mcu_request_version()
> >     - Use pr_debug in set_ally_mcu_hack() and set_ally_mcu_powersave() plus
> >       correct the message.
> > 
> > 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 |  15 +++
> >  3 files changed, 215 insertions(+), 41 deletions(-)
> 
> Hans, are you OK taking both patches through your tree?

Yes, I can take them both.

-- 
 i.
Re: [PATCH v3 0/2] hid-asus: asus-wmi: refactor Ally suspend/resume
Posted by Mario Limonciello 9 months, 3 weeks ago
On 2/27/2025 02:58, 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.
> 
> *Note: In review it was requested by Mario that I try strsep() for parsing
> the version. I did try this and a few variations but the result was much
> more code due to having to check more edge cases due to the input being
> raw bytes. In the end the cleaned up while loop proved more robust.
> 
> - Changelog:
>    + V2: https://lore.kernel.org/platform-driver-x86/20250226010129.32043-1-luke@ljones.dev/T/#t
>      - 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
>      - Remove noise (excess pr_info)
>      - Use kstrtoint, not kstrtolong
>      - Use __free(kfree) for allocated mem and drop goto + logging
>      - Use print_hex_dump() to show failed data after pr_err in mcu_request_version()
>      - Use pr_debug in set_ally_mcu_hack() and set_ally_mcu_powersave() plus
>        correct the message.
> 
> 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 |  15 +++
>   3 files changed, 215 insertions(+), 41 deletions(-)
> 

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>