Skip to contentSkip to conversation

platfom/x86: asus-wmi: revert ROG Ally quirks

PATCH In review Luke D. Jones 5 participants 12 messages Sep 26, 2024 – Oct 8, 2024

Subsystems (2)
lore
Share & tools
lore

Luke D. Jones

author maintainer
#0 lore raw

cover platfom/x86: asus-wmi: revert ROG Ally quirks

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

All users should update to MCU FW as soon as released to:
- Ally 1: v319
- Ally X: v313

Luke D. Jones (3):
Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU
powersave"
Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before
suspend"
platfom/x86: asus-wmi: cleanup after Ally quirk reverts

 drivers/platform/x86/asus-wmi.c | 39 +--------------------------------
 1 file changed, 1 insertion(+), 38 deletions(-)
Signature · 1 line
2.46.1
author maintainer
#1 lore raw

PATCH 1/3 Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU powersave"

This reverts commit 7e7a5dee49732ed01a3a17c9a3edf027fb9457fe.

This is part of some hacks that are no-longer required when users have updated their MCU firmware to the latest version:
- Ally 1: v319
- Ally X: v313

---
 drivers/platform/x86/asus-wmi.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/platform/x86/asus-wmi.c +10 -2
index 08861792bddd..8daefd9a0d94 100644
@@ -146,7 +146,7 @@ module_param(fnlock_default, bool, 0444);
 /* Controls the power state of the USB0 hub on ROG Ally which input is on */
 #define ASUS_USB0_PWR_EC0_CSEE "\\_SB.PCI0.SBRG.EC0.CSEE"
 /* 300ms so far seems to produce a reliable result on AC and battery */
-#define ASUS_USB0_PWR_EC0_CSEE_WAIT 1500
+#define ASUS_USB0_PWR_EC0_CSEE_WAIT 300
 
 static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
 
@@ -4971,7 +4971,6 @@ static int asus_hotk_resume_early(struct device *device)
 	struct asus_wmi *asus = dev_get_drvdata(device);
 
 	if (asus->ally_mcu_usb_switch) {
-		/* sleep required to prevent USB0 being yanked then reappearing rapidly */
 		if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB8)))
 			dev_err(device, "ROG Ally MCU failed to connect USB dev\n");
 		else
@@ -4983,8 +4982,17 @@ static int asus_hotk_resume_early(struct device *device)
 static int asus_hotk_prepare(struct device *device)
 {
 	struct asus_wmi *asus = dev_get_drvdata(device);
+	int result, err;
 
 	if (asus->ally_mcu_usb_switch) {
+		/* When powersave is enabled it causes many issues with resume of USB hub */
+		result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MCU_POWERSAVE);
+		if (result == 1) {
+			dev_warn(device, "MCU powersave enabled, disabling to prevent resume issues");
+			err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, 0, &result);
+			if (err || result != 1)
+				dev_err(device, "Failed to set MCU powersave mode: %d\n", err);
+		}
 		/* sleep required to ensure USB0 is disabled before sleep continues */
 		if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB7)))
 			dev_err(device, "ROG Ally MCU failed to disconnect USB dev\n");
Signature · 1 line
2.46.1
author maintainer
#2 lore raw

PATCH 2/3 Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend"

In reply to Luke D. Jones

This reverts commit e0894ff038d86f30614ec16ec26dacb88c8d2bd4.

This is part of some hacks that are no-longer required when users have updated their MCU firmware to the latest version:
- Ally 1: v319
- Ally X: v313

---
 drivers/platform/x86/asus-wmi.c | 40 ---------------------------------
 1 file changed, 40 deletions(-)
drivers/platform/x86/asus-wmi.c +0 -40
index 8daefd9a0d94..27b9fa2c29ae 100644
@@ -16,7 +16,6 @@
 #include <linux/acpi.h>
 #include <linux/backlight.h>
 #include <linux/debugfs.h>
-#include <linux/delay.h>
 #include <linux/dmi.h>
 #include <linux/fb.h>
 #include <linux/hwmon.h>
@@ -4962,43 +4961,6 @@ static int asus_hotk_resume(struct device *device)
 		asus_wmi_fnlock_update(asus);
 
 	asus_wmi_tablet_mode_get_state(asus);
-
-	return 0;
-}
-
-static int asus_hotk_resume_early(struct device *device)
-{
-	struct asus_wmi *asus = dev_get_drvdata(device);
-
-	if (asus->ally_mcu_usb_switch) {
-		if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB8)))
-			dev_err(device, "ROG Ally MCU failed to connect USB dev\n");
-		else
-			msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
-	}
-	return 0;
-}
-
-static int asus_hotk_prepare(struct device *device)
-{
-	struct asus_wmi *asus = dev_get_drvdata(device);
-	int result, err;
-
-	if (asus->ally_mcu_usb_switch) {
-		/* When powersave is enabled it causes many issues with resume of USB hub */
-		result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_MCU_POWERSAVE);
-		if (result == 1) {
-			dev_warn(device, "MCU powersave enabled, disabling to prevent resume issues");
-			err = asus_wmi_set_devstate(ASUS_WMI_DEVID_MCU_POWERSAVE, 0, &result);
-			if (err || result != 1)
-				dev_err(device, "Failed to set MCU powersave mode: %d\n", err);
-		}
-		/* sleep required to ensure USB0 is disabled before sleep continues */
-		if (ACPI_FAILURE(acpi_execute_simple_method(NULL, ASUS_USB0_PWR_EC0_CSEE, 0xB7)))
-			dev_err(device, "ROG Ally MCU failed to disconnect USB dev\n");
-		else
-			msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
-	}
 	return 0;
 }
 
@@ -5046,8 +5008,6 @@ static const struct dev_pm_ops asus_pm_ops = {
 	.thaw = asus_hotk_thaw,
 	.restore = asus_hotk_restore,
 	.resume = asus_hotk_resume,
-	.resume_early = asus_hotk_resume_early,
-	.prepare = asus_hotk_prepare,
 };
 
 /* Registration ***************************************************************/
Signature · 1 line
2.46.1
author maintainer
#3 lore raw

PATCH 3/3 platfom/x86: asus-wmi: cleanup after Ally quirk reverts

In reply to Luke D. Jones

Cleanup some leftover code after reverting:
- 7e7a5dee49732ed01a3a17c9a3edf027fb9457fe
- e0894ff038d86f30614ec16ec26dacb88c8d2bd4

This is part of some hacks that are no-longer required when users have updated their MCU firmware to the latest version:
- Ally 1: v319
- Ally X: v313

---
 drivers/platform/x86/asus-wmi.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/platform/x86/asus-wmi.c +0 -5
index 27b9fa2c29ae..2c4094004549 100644
@@ -274,9 +274,6 @@ struct asus_wmi {
 	u32 tablet_switch_dev_id;
 	bool tablet_switch_inverted;
 
-	/* The ROG Ally device requires the MCU USB device be disconnected before suspend */
-	bool ally_mcu_usb_switch;
-
 	enum fan_type fan_type;
 	enum fan_type gpu_fan_type;
 	enum fan_type mid_fan_type;
@@ -4773,8 +4770,6 @@ static int asus_wmi_add(struct platform_device *pdev)
 	asus->egpu_enable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_EGPU);
 	asus->dgpu_disable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_DGPU);
 	asus->kbd_rgb_state_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_STATE);
-	asus->ally_mcu_usb_switch = acpi_has_method(NULL, ASUS_USB0_PWR_EC0_CSEE)
-						&& dmi_check_system(asus_ally_mcu_quirk);
 
 	if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_MINI_LED_MODE))
 		asus->mini_led_dev_id = ASUS_WMI_DEVID_MINI_LED_MODE;
Signature · 1 line
2.46.1
#4 lore raw

Re: [PATCH 3/3] platfom/x86: asus-wmi: cleanup after Ally quirk reverts

kernel test robot noticed the following build warnings:

Hi Luke,

kernel test robot noticed the following build warnings:

[auto build test WARNING on amd-pstate/bleeding-edge]
[also build test WARNING on linus/master v6.11 next-20240927] [cannot apply to amd-pstate/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Luke-D-Jones/Revert-platform-x86-asus-wmi-ROG-Ally-increase-wait-time-allow-MCU-powersave/20240926-175641
base:   https://git.kernel.org/pub/scm/linux/kernel/git/superm1/linux.git bleeding-edge
patch link:    https://lore.kernel.org/r/20240926095344.1291013-4-luke%40ljones.dev
patch subject: [PATCH 3/3] platfom/x86: asus-wmi: cleanup after Ally quirk reverts
config: x86_64-rhel-8.3-func (https://download.01.org/0day-ci/archive/20240929/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240929/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/platform/x86/asus-wmi.c:148:35: warning: 'asus_ally_mcu_quirk' defined but not used [-Wunused-const-variable=]
     148 | static const struct dmi_system_id asus_ally_mcu_quirk[] = {
         |                                   ^~~~~~~~~~~~~~~~~~~

vim +/asus_ally_mcu_quirk +148 drivers/platform/x86/asus-wmi.c

0f0ac158d28ff7 Luke D. Jones 2021-10-24 147

d2dfed310aae07 Luke D. Jones 2024-08-06 @148  static const struct dmi_system_id asus_ally_mcu_quirk[] = {
d2dfed310aae07 Luke D. Jones 2024-08-06  149  	{
d2dfed310aae07 Luke D. Jones 2024-08-06  150  		.matches = {
d2dfed310aae07 Luke D. Jones 2024-08-06  151  			DMI_MATCH(DMI_BOARD_NAME, "RC71L"),
d2dfed310aae07 Luke D. Jones 2024-08-06  152  		},
d2dfed310aae07 Luke D. Jones 2024-08-06  153  	},
d2dfed310aae07 Luke D. Jones 2024-08-06  154  	{
d2dfed310aae07 Luke D. Jones 2024-08-06  155  		.matches = {
d2dfed310aae07 Luke D. Jones 2024-08-06  156  			DMI_MATCH(DMI_BOARD_NAME, "RC72L"),
d2dfed310aae07 Luke D. Jones 2024-08-06  157  		},
d2dfed310aae07 Luke D. Jones 2024-08-06  158  	},
d2dfed310aae07 Luke D. Jones 2024-08-06  159  	{ },
d2dfed310aae07 Luke D. Jones 2024-08-06  160  };

d2dfed310aae07 Luke D. Jones 2024-08-06 161

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Reviewed-by on the v1 series
#5 lore raw
In reply to Luke D. Jones
Quoted 16 lines · Luke D. Jones

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

All users should update to MCU FW as soon as released to:
- Ally 1: v319
- Ally X: v313

Luke D. Jones (3):
Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU
powersave"
Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before
suspend"
platfom/x86: asus-wmi: cleanup after Ally quirk reverts

Quoted 3 lines
  drivers/platform/x86/asus-wmi.c | 39 +--------------------------------
  1 file changed, 1 insertion(+), 38 deletions(-)

This series looks good to me, but I would suggest that you also in the appropriate HID driver that communicates with the MCU to show a warning or notice if the version is below the required version.

author maintainer
#6 lore raw
Quoted 21 lines · Mario Limonciello
Quoted 16 lines · Luke D. Jones

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

All users should update to MCU FW as soon as released to:
- Ally 1: v319
- Ally X: v313

Luke D. Jones (3):
Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU
powersave"
Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before
suspend"
platfom/x86: asus-wmi: cleanup after Ally quirk reverts

Quoted 3 lines
  drivers/platform/x86/asus-wmi.c | 39 +--------------------------------
  1 file changed, 1 insertion(+), 38 deletions(-)
Quoted 5 lines

This series looks good to me, but I would suggest that you also in the appropriate HID driver that communicates with the MCU to show a warning or notice if the version is below the required version.

I have something that works, but it's in the hid-asus-ally driver. Since that might take a while to prepare I think I'll bring it over to this series soon.

#7 lore raw
In reply to Luke D. Jones

Hi Luke,

Quoted 4 lines · Luke D. Jones

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

First of all let me say that it is great that you have gotten Asus to come up with a fixed firmware, thank you.

With that said I believe that it is way too early to revert these quirks, users are usually not great at installing BIOS updates and that assumes this will be handled as part of a BIOS update, if it requires running a separate tool then the chances of users not installing the update will likely be even worse.

So IMHO for now we should keep these quirks around to avoid regressions for users who don't have the MCU update.

Related, have you seen this series:

https://lore.kernel.org/platform-driver-x86/[email protected]/

that seems to fix the same issue ?

And it does so in another, arguably better way.

Although unfortunately as patch 3/5 shows just calling the global "display off" callback before suspending devices is not enough fixing things still requires inserting a sleep using a DMI quirk :|

Still that series including the DMI quirk might be a cleaner way to deal with this and if that is merged then dropping the quirks from asus-wmi makes sense.

Regards,

Hans

Quoted 14 lines

All users should update to MCU FW as soon as released to:
- Ally 1: v319
- Ally X: v313

Luke D. Jones (3):
Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU
powersave"
Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before
suspend"
platfom/x86: asus-wmi: cleanup after Ally quirk reverts

 drivers/platform/x86/asus-wmi.c | 39 +--------------------------------
 1 file changed, 1 insertion(+), 38 deletions(-)
author maintainer
#8 lore raw

Hi Hans,

Quoted 11 lines · Hans de Goede

Hi Luke,

Quoted 4 lines · Luke D. Jones

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

First of all let me say that it is great that you have gotten Asus to come up with a fixed firmware, thank you.

Quoted 8 lines

With that said I believe that it is way too early to revert these quirks, users are usually not great at installing BIOS updates and that assumes this will be handled as part of a BIOS update, if it requires running a separate tool then the chances of users not installing the update will likely be even worse.

So IMHO for now we should keep these quirks around to avoid regressions for users who don't have the MCU update.

I wasn't sure how best to handle it, mostly the intention was to publicise things. In any case the quirks don't affect the new FW update at all and most folks won't ever notice.

Quoted 5 lines

Related, have you seen this series:

https://lore.kernel.org/platform-driver-x86/[email protected]/

that seems to fix the same issue ?

The history of that is here https://lore.kernel.org/linux-pm/[email protected]/#t

Quoted 1 line

And it does so in another, arguably better way.

It is a variation of the many many things I've tried while building a comprehensive set of data for ASUS to work with. You can achieve a similar thing with only s2idle_pm callbacks and Mario's patches to export the DSM screen-off as an external symbol. Better is subjective since it still fails to fix the initial reason this work ever started - fixing the Ally - unless delays are added.

Quoted 3 lines

Although unfortunately as patch 3/5 shows just calling the global "display off" callback before suspending devices is not enough fixing things still requires inserting a sleep using a DMI quirk :|

This is because the issue can only be fully fixed in FW. What is happening here is just another variation of the quirk and the things I mentioned above. It gets worse with different compiler such as clang, or different kernel config, or even distro. The cause of issues is that a particular signal the MCU is waiting on may not occur and that becomes wildly unpredictable depending on kernel config, compiler etc.

Even Windows can have the issue we have here.

Quoted 3 lines

Still that series including the DMI quirk might be a cleaner way to deal with this and if that is merged then dropping the quirks from asus-wmi makes sense.

All of this is fully negated by the coming firmware. Having said that, *if* there are any issues with these patches then those issues will never come to light with the new MCU FW either as it fixes the root cause of the issues seen.

The mentioned patches achieve a similar result to using Mario's s2idle callback patches and using those in s2idle_pm_ops. But as seen above, the timing issue becomes apparent - and this is fixed only by using fixed FW.

Kind regards,
Luke.

Quoted 21 lines

Regards,

Hans

Quoted 14 lines

All users should update to MCU FW as soon as released to:
- Ally 1: v319
- Ally X: v313

Luke D. Jones (3):
Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU
powersave"
Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before
suspend"
platfom/x86: asus-wmi: cleanup after Ally quirk reverts

 drivers/platform/x86/asus-wmi.c | 39 +--------------------------------
 1 file changed, 1 insertion(+), 38 deletions(-)
#9 lore raw

Hi Luke,

Quoted 20 lines · Luke Jones

Hi Hans,

Quoted 17 lines · Hans de Goede

Hi Luke,

Quoted 4 lines · Luke D. Jones

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

First of all let me say that it is great that you have gotten Asus to come up with a fixed firmware, thank you.

With that said I believe that it is way too early to revert these quirks, users are usually not great at installing BIOS updates and that assumes this will be handled as part of a BIOS update, if it requires running a separate tool then the chances of users not installing the update will likely be even worse.

Quoted 4 lines
Quoted 2 lines

So IMHO for now we should keep these quirks around to avoid regressions for users who don't have the MCU update.

I wasn't sure how best to handle it, mostly the intention was to publicise things. In any case the quirks don't affect the new FW update at all and most folks won't ever notice.

I think we can look at dropping the quirks in maybe a year from now or some such. Doing it right now feels like a bit to quick after the fw fix.

And as mentioned elsewhere in the thread, if possible it would be good if some other driver. e.g. hid-asus could check the FW version and log a warning if the old version is still found.

Quoted 18 lines
Quoted 5 lines

Related, have you seen this series:

https://lore.kernel.org/platform-driver-x86/[email protected]/

that seems to fix the same issue ?

The history of that is here https://lore.kernel.org/linux-pm/[email protected]/#t

Quoted 1 line

And it does so in another, arguably better way.

It is a variation of the many many things I've tried while building a comprehensive set of data for ASUS to work with. You can achieve a similar thing with only s2idle_pm callbacks and Mario's patches to export the DSM screen-off as an external symbol. Better is subjective since it still fails to fix the initial reason this work ever started - fixing the Ally - unless delays are added.

Quoted 3 lines

Although unfortunately as patch 3/5 shows just calling the global "display off" callback before suspending devices is not enough fixing things still requires inserting a sleep using a DMI quirk :|

This is because the issue can only be fully fixed in FW. What is happening here is just another variation of the quirk and the things I mentioned above. It gets worse with different compiler such as clang, or different kernel config, or even distro. The cause of issues is that a particular signal the MCU is waiting on may not occur and that becomes wildly unpredictable depending on kernel config, compiler etc.

Quoted 7 lines

Even Windows can have the issue we have here.

Quoted 3 lines

Still that series including the DMI quirk might be a cleaner way to deal with this and if that is merged then dropping the quirks from asus-wmi makes sense.

All of this is fully negated by the coming firmware. Having said that, *if* there are any issues with these patches then those issues will never come to light with the new MCU FW either as it fixes the root cause of the issues seen.

That sounds great, once more thank you for working with Asus to properly fix this.

Quoted 1 line

The mentioned patches achieve a similar result to using Mario's s2idle callback patches and using those in s2idle_pm_ops. But as seen above, the timing issue becomes apparent - and this is fixed only by using fixed FW.

Right. As I mentioned already in the other thread I am having second doubts about moving the LPS0 display power off call to before devices are suspended, doing so would mean that the display might still be on when that call is made and that call could disable power-resources which are necessary for the display causing issues when the display driver's suspend method runs.

So I think that we need something closer to Mario's original POC from:

https://git.kernel.org/pub/scm/linux/kernel/git/superm1/linux.git/log/?h=superm1/dsm-screen-on-off

if we want to make the suspend order more like Windows and make the LPS0 display off call when the last display is turned off.

And as you have explained making the suspend order more like Windows is unrelated to the real cause for the ROG Ally MCU suspend issue, so lets continue any discussion about suspend ordering in the other thread.

Regards,

Hans

author maintainer
#10 lore raw
In reply to Luke Jones
Quoted 67 lines · Luke Jones

Hi Hans,

Quoted 11 lines · Hans de Goede

Hi Luke,

Quoted 4 lines · Luke D. Jones

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

First of all let me say that it is great that you have gotten Asus to come up with a fixed firmware, thank you.

Quoted 8 lines

With that said I believe that it is way too early to revert these quirks, users are usually not great at installing BIOS updates and that assumes this will be handled as part of a BIOS update, if it requires running a separate tool then the chances of users not installing the update will likely be even worse.

So IMHO for now we should keep these quirks around to avoid regressions for users who don't have the MCU update.

I wasn't sure how best to handle it, mostly the intention was to publicise things. In any case the quirks don't affect the new FW update at all and most folks won't ever notice.

Quoted 5 lines

Related, have you seen this series:

https://lore.kernel.org/platform-driver-x86/[email protected]/

that seems to fix the same issue ?

The history of that is here
https://lore.kernel.org/linux-pm/[email protected]/#t

Quoted 1 line

And it does so in another, arguably better way.

It is a variation of the many many things I've tried while building a comprehensive set of data for ASUS to work with. You can achieve a similar thing with only s2idle_pm callbacks and Mario's patches to export the DSM screen-off as an external symbol. Better is subjective since it still fails to fix the initial reason this work ever started - fixing the Ally - unless delays are added.

Quoted 3 lines

Although unfortunately as patch 3/5 shows just calling the global "display off" callback before suspending devices is not enough fixing things still requires inserting a sleep using a DMI quirk :|

This is because the issue can only be fully fixed in FW. What is happening here is just another variation of the quirk and the things I mentioned above. It gets worse with different compiler such as clang, or different kernel config, or even distro. The cause of issues is that a particular signal the MCU is waiting on may not occur and that becomes wildly unpredictable depending on kernel config, compiler etc.

Even Windows can have the issue we have here.

Quoted 3 lines

Still that series including the DMI quirk might be a cleaner way to deal with this and if that is merged then dropping the quirks from asus-wmi makes sense.

All of this is fully negated by the coming firmware. Having said that, *if* there are any issues with these patches then those issues will never come to light with the new MCU FW either as it fixes the root cause of the issues seen.

Quoted 4 lines

The mentioned patches achieve a similar result to using Mario's s2idle callback patches and using those in s2idle_pm_ops. But as seen above, the timing issue becomes apparent - and this is fixed only by using fixed FW.

Hi Mario,

I am now wondering if there is some merit still in upstreaming your original series plus the asus-wmi patch based on those. The benefit for asus-wmi is that it is cleaned up a lot, and the delay can be reduced.

I can likely achieve the same thing using the CSEE calls manually but shifting to the s2idle_pm callback for suspend since the main thing is just ensuring device recovery with no regard for powersave.

The main reason for this consideration now is due to requiring some form of it to remain for a while as Hans requests. I already know from testing that there is zero negative effect on the coming MCU update and most users won't notice at all, but I would very much like to improve the current hack.

One other consideration though is that I've found it pretty difficult to get some kind of safe HID request done through asus-wmi to fetch the MCU FW version and disable this quirk based on that, but I could possibly go in the other direction and have the hid-asus-* drivers find the asus-ally driver data and flip a switch to on/off these quirks. That would apply only for suspend/resume and not the reboot fix though.

Quoted 24 lines

Kind regards,
Luke.

Quoted 21 lines

Regards,

Hans

Quoted 14 lines

All users should update to MCU FW as soon as released to:
- Ally 1: v319
- Ally X: v313

Luke D. Jones (3):
Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU
powersave"
Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before
suspend"
platfom/x86: asus-wmi: cleanup after Ally quirk reverts

 drivers/platform/x86/asus-wmi.c | 39 +--------------------------------
 1 file changed, 1 insertion(+), 38 deletions(-)
#11 lore raw
Quoted 75 lines · Luke Jones
Quoted 67 lines · Luke Jones

Hi Hans,

Quoted 11 lines · Hans de Goede

Hi Luke,

Quoted 4 lines · Luke D. Jones

The ASUS ROG Ally (and Ally X) quirks that I added over the last year are not required. I worked with ASUS to pinpoint the exact cause of the original issue (MCU USB dev missing every second resume) and the result is a new MCU firmware which will be released on approx 16/10/24.

First of all let me say that it is great that you have gotten Asus to come up with a fixed firmware, thank you.

Quoted 8 lines

With that said I believe that it is way too early to revert these quirks, users are usually not great at installing BIOS updates and that assumes this will be handled as part of a BIOS update, if it requires running a separate tool then the chances of users not installing the update will likely be even worse.

So IMHO for now we should keep these quirks around to avoid regressions for users who don't have the MCU update.

I wasn't sure how best to handle it, mostly the intention was to publicise things. In any case the quirks don't affect the new FW update at all and most folks won't ever notice.

Quoted 5 lines

Related, have you seen this series:

https://lore.kernel.org/platform-driver-x86/[email protected]/

that seems to fix the same issue ?

The history of that is here
https://lore.kernel.org/linux-pm/[email protected]/#t

Quoted 1 line

And it does so in another, arguably better way.

It is a variation of the many many things I've tried while building a comprehensive set of data for ASUS to work with. You can achieve a similar thing with only s2idle_pm callbacks and Mario's patches to export the DSM screen-off as an external symbol. Better is subjective since it still fails to fix the initial reason this work ever started - fixing the Ally - unless delays are added.

Quoted 3 lines

Although unfortunately as patch 3/5 shows just calling the global "display off" callback before suspending devices is not enough fixing things still requires inserting a sleep using a DMI quirk :|

This is because the issue can only be fully fixed in FW. What is happening here is just another variation of the quirk and the things I mentioned above. It gets worse with different compiler such as clang, or different kernel config, or even distro. The cause of issues is that a particular signal the MCU is waiting on may not occur and that becomes wildly unpredictable depending on kernel config, compiler etc.

Even Windows can have the issue we have here.

Quoted 3 lines

Still that series including the DMI quirk might be a cleaner way to deal with this and if that is merged then dropping the quirks from asus-wmi makes sense.

All of this is fully negated by the coming firmware. Having said that, *if* there are any issues with these patches then those issues will never come to light with the new MCU FW either as it fixes the root cause of the issues seen.

Quoted 4 lines

The mentioned patches achieve a similar result to using Mario's s2idle callback patches and using those in s2idle_pm_ops. But as seen above, the timing issue becomes apparent - and this is fixed only by using fixed FW.

Quoted 8 lines

Hi Mario,

I am now wondering if there is some merit still in upstreaming your original series plus the asus-wmi patch based on those. The benefit for asus-wmi is that it is cleaned up a lot, and the delay can be reduced.

I can likely achieve the same thing using the CSEE calls manually but shifting to the s2idle_pm callback for suspend since the main thing is just ensuring device recovery with no regard for powersave.

The main reason for this consideration now is due to requiring some form of it to remain for a while as Hans requests. I already know from testing that there is zero negative effect on the coming MCU update and most users won't notice at all, but I would very much like to improve the current hack.

I'm totally fine with that. As you have the asus-wmi patch based on those that worked best would you mind dropping it all together as a series to all 3 mailing lists (linux-pm/dri-devel/platform-x86?

I double checked and my 3 patches apply cleanly still on 6.12-rc2.

Quoted 1 line

One other consideration though is that I've found it pretty difficult to get some kind of safe HID request done through asus-wmi to fetch the MCU FW version and disable this quirk based on that, but I could possibly go in the other direction and have the hid-asus-* drivers find the asus-ally driver data and flip a switch to on/off these quirks. That would apply only for suspend/resume and not the reboot fix though.

I think once the hid-asus drivers land you can export a symbol that provides that information of the firmware version. asus-wmi can have a dependency on those drivers and call that symbol and then make decisions on the quirks based on it.

Quoted 27 lines
Quoted 26 lines

Kind regards,
Luke.

Quoted 21 lines

Regards,

Hans

Quoted 14 lines

All users should update to MCU FW as soon as released to:
- Ally 1: v319
- Ally X: v313

Luke D. Jones (3):
Revert "platform/x86: asus-wmi: ROG Ally increase wait time, allow MCU
powersave"
Revert "platform/x86: asus-wmi: disable USB0 hub on ROG Ally before
suspend"
platfom/x86: asus-wmi: cleanup after Ally quirk reverts

  drivers/platform/x86/asus-wmi.c | 39 +--------------------------------
  1 file changed, 1 insertion(+), 38 deletions(-)