* [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups
@ 2025-09-03 16:23 aprilgrimoire
2025-09-03 16:50 ` Mario Limonciello
0 siblings, 1 reply; 11+ messages in thread
From: aprilgrimoire @ 2025-09-03 16:23 UTC (permalink / raw)
To: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org
Cc: mario.limonciello@amd.com
Hi!
Opening or closing the lid causes my laptop Yilong15Pro GM5HG7A to wake up from s2idle, similar to the symptom described in
https://community.frame.work/t/tracking-waking-from-sleep-when-plugged-in-amd-k-ubuntu-22-04/44168
This issue for Framework 13 has been fixed in
https://lore.kernel.org/platform-driver-x86/20231212045006.97581-5-mario.limonciello@amd.com/
For me specifically, two interrupts appear on such unwanted wakeups: IRQ1 and IRQ7. IRQ1 is the lid switch, with DRIVER==button. IRQ7 has SUBSYSTEM==serio and DRIVER==amd_gpio. I tried some workarounds and got to disable IRQ1, but IRQ7 doesn't support disabling and the issue persists.
I did some modifications to the kernel code:
----- drivers/platform/x86/amd/pmc/pmc.c
static int amd_pmc_wa_irq1(struct amd_pmc_dev *pdev)
{
...
if (device_may_wakeup(d)) {
dev_info_once(d, "Disabling IRQ1 wakeup source to avoid platform firmware bug\n");
disable_irq_wake(1);
dev_warn(d, "Also disabling IRQ7!!! This is bad practice!!! Remove after testing IMMEDIATELY!!!");
disable_irq_wake(7);
device_set_wakeup_enable(d, false);
}
...
}
----- drivers/platform/x86/amd/pmc/pmc-quirks.c
...
{
.ident = "MECHREVO Yilong15Pro Series GM5HG7A",
.driver_data = &quirk_spurious_8042,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "MECHREVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "Yilong15Pro Series GM5HG7A"),
/* Not matching BIOS version: MECHREVO doesn't support Linux officially, so no expectation of them fixing the bios. */
}
},
...
But IRC7 cannot be disabled:
(base) ➜ ~ echo disabled | sudo tee /sys/kernel/irq/7/wakeup
Password:
tee: /sys/kernel/irq/7/wakeup: Permission denied
In dsdt.dsl, I also nuked some code about the lid state and changed all SharedAndWake to Shared, however it didn't work either.
Mechrevo officially only supports Windows, and this lid issue doesn't appear on Windows. Does this indicate this issue can be workaround in the driver level? What can be done next?
Thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups
2025-09-03 16:23 [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups aprilgrimoire
@ 2025-09-03 16:50 ` Mario Limonciello
2025-09-03 17:13 ` aprilgrimoire
0 siblings, 1 reply; 11+ messages in thread
From: Mario Limonciello @ 2025-09-03 16:50 UTC (permalink / raw)
To: aprilgrimoire, linux-pm@vger.kernel.org,
linux-acpi@vger.kernel.org
On 9/3/25 11:23 AM, aprilgrimoire wrote:
> Hi!
> Opening or closing the lid causes my laptop Yilong15Pro GM5HG7A to wake up from s2idle, similar to the symptom described in
>
> https://community.frame.work/t/tracking-waking-from-sleep-when-plugged-in-amd-k-ubuntu-22-04/44168
>
> This issue for Framework 13 has been fixed in
>
> https://lore.kernel.org/platform-driver-x86/20231212045006.97581-5-mario.limonciello@amd.com/
>
> For me specifically, two interrupts appear on such unwanted wakeups: IRQ1 and IRQ7. IRQ1 is the lid switch, with DRIVER==button. IRQ7 has SUBSYSTEM==serio and DRIVER==amd_gpio. I tried some workarounds and got to disable IRQ1, but IRQ7 doesn't support disabling and the issue persists.
>
> I did some modifications to the kernel code:
>
> ----- drivers/platform/x86/amd/pmc/pmc.c
>
> static int amd_pmc_wa_irq1(struct amd_pmc_dev *pdev)
> {
> ...
> if (device_may_wakeup(d)) {
> dev_info_once(d, "Disabling IRQ1 wakeup source to avoid platform firmware bug\n");
> disable_irq_wake(1);
> dev_warn(d, "Also disabling IRQ7!!! This is bad practice!!! Remove after testing IMMEDIATELY!!!");
> disable_irq_wake(7);
> device_set_wakeup_enable(d, false);
> }
> ...
> }
>
> ----- drivers/platform/x86/amd/pmc/pmc-quirks.c
> ...
> {
> .ident = "MECHREVO Yilong15Pro Series GM5HG7A",
> .driver_data = &quirk_spurious_8042,
> .matches = {
> DMI_MATCH(DMI_SYS_VENDOR, "MECHREVO"),
> DMI_MATCH(DMI_PRODUCT_NAME, "Yilong15Pro Series GM5HG7A"),
> /* Not matching BIOS version: MECHREVO doesn't support Linux officially, so no expectation of them fixing the bios. */
> }
> },
> ...
>
> But IRC7 cannot be disabled:
>
> (base) ➜ ~ echo disabled | sudo tee /sys/kernel/irq/7/wakeup
> Password:
> tee: /sys/kernel/irq/7/wakeup: Permission denied
>
> In dsdt.dsl, I also nuked some code about the lid state and changed all SharedAndWake to Shared, however it didn't work either.
>
> Mechrevo officially only supports Windows, and this lid issue doesn't appear on Windows. Does this indicate this issue can be workaround in the driver level? What can be done next?
>
> Thanks!
Hi,
Can you please reproduce the issue using 'amd-s2idle' from
https://pypi.org/project/amd-debug-tools/ ?
Basically install the wheel, run 'amd-s2idle test'. When prompted how
long, set it for ~20 seconds. Then wait for the LED to flash and close
the lid and it should wake up and generate a report.
This will capture a lot of artifacts about the problem in the report and
we can go from there on next steps. Ideally if you can put the report
on a new issue here and tag me (@superm1):
https://gitlab.freedesktop.org/drm/amd/-/issues
We can iterate back and forth on it to come up with the best solution.
Thanks,
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups
2025-09-03 16:50 ` Mario Limonciello
@ 2025-09-03 17:13 ` aprilgrimoire
2025-09-03 17:32 ` Mario Limonciello
0 siblings, 1 reply; 11+ messages in thread
From: aprilgrimoire @ 2025-09-03 17:13 UTC (permalink / raw)
To: Mario Limonciello; +Cc: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org
> Hi,
>
> Can you please reproduce the issue using 'amd-s2idle' from
> https://pypi.org/project/amd-debug-tools/ ?
>
> Basically install the wheel, run 'amd-s2idle test'. When prompted how
> long, set it for ~20 seconds. Then wait for the LED to flash and close
> the lid and it should wake up and generate a report.
>
> This will capture a lot of artifacts about the problem in the report and
> we can go from there on next steps. Ideally if you can put the report
> on a new issue here and tag me (@superm1):
> https://gitlab.freedesktop.org/drm/amd/-/issues
> We can iterate back and forth on it to come up with the best solution.
>
> Thanks,
Hi! Here's the output:
https://paste.gentoo.zip/mpV8dQcl
I disabled the patched dsdt since with it amd-s2idle would think ASPM Policy is set to power-saving and refuse to run.
It's late here and I'll probably return tomorrow. Thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups
2025-09-03 17:13 ` aprilgrimoire
@ 2025-09-03 17:32 ` Mario Limonciello
[not found] ` <vVnKVxELkDdxFLiNbtGhT9X7GA_OV3Wk7q6YB_K4Qz3N8Dfp-MCcZqeobEP8dX-H4kjqKzYqyloahoaxB6ZEp8l9XgkIrD8S27Ertjwq324=@proton.me>
[not found] ` <lyy4riGTLOpvYTPUeUx6krjnYdeE8iYbWRrLOJLOChOKMcys00nhNWJ_JD8V8kkVQk87ktMK8w7BAEosOs3KGipyHlvkvQ0_j6cipUfxYtA=@proton.me>
0 siblings, 2 replies; 11+ messages in thread
From: Mario Limonciello @ 2025-09-03 17:32 UTC (permalink / raw)
To: aprilgrimoire; +Cc: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org
On 9/3/25 12:13 PM, aprilgrimoire wrote:
>
>> Hi,
>>
>> Can you please reproduce the issue using 'amd-s2idle' from
>> https://pypi.org/project/amd-debug-tools/ ?
>>
>> Basically install the wheel, run 'amd-s2idle test'. When prompted how
>> long, set it for ~20 seconds. Then wait for the LED to flash and close
>> the lid and it should wake up and generate a report.
>>
>> This will capture a lot of artifacts about the problem in the report and
>> we can go from there on next steps. Ideally if you can put the report
>> on a new issue here and tag me (@superm1):
>> https://gitlab.freedesktop.org/drm/amd/-/issues
>> We can iterate back and forth on it to come up with the best solution.
>>
>> Thanks,
>
> Hi! Here's the output:
>
> https://paste.gentoo.zip/mpV8dQcl
>
> I disabled the patched dsdt since with it amd-s2idle would think ASPM Policy is set to power-saving and refuse to run.
>
> It's late here and I'll probably return tomorrow. Thanks!
IRQ1 doesn't show up in this report, so this is not a problem with the
keyboard wakeup.
There's a few things that stand out to me.
1) There are ACPI errors with the PEP _DSM; specificially the screen on
action. This isn't likely the cause of this issue but it's most
definitely a BIOS bug.
ACPI BIOS Error (bug): Could not resolve symbol [\_SB.ACDC.RTAC],
AE_NOT_FOUND (20250404/psargs-332)
ACPI Error: Aborting method \_SB.PEP._DSM due to previous error
(AE_NOT_FOUND) (20250404/psparse-529)
ACPI: \_SB_.PEP_: Failed to transitioned to state screen on
2) The wakeup is from IRQ 7 (like you said) which is the GPIO controller.
PM: Triggering wakeup from IRQ 7
Woke up from IRQ 7 (IR-IO-APIC 7-fasteoi pinctrl_amd)
The GPIO controller wakes up the system when any of the pins that are
marked as wake pins are triggered. In your case this is GPIO 0.
GPIO 0 is active: 0x38157800
According to the SSDT _EVT handler this notifies the _PWRB ACPI object.
Case (Zero)
{
M000 (0x3900)
Notify (\_SB.PWRB, 0x80) // Status Change
}
We can see that notify happened here:
Dispatching Notify on [PWRB] (Device) Value 0x80 (Status Change)
So based on above what it looks like is going on to me is that the lid
is likely indirectly tied to GPIO 0 in this design. It's not clear if
it's a mux, directly connected or if the EC drives that GPIO or what not.
It's worth noting that we did have a Linux kernel change to turn off
debounce for all GPIOs recently at suspend time [1]. You can see in
your log this message associated with it.
Clearing debounce for GPIO #0 during suspend.
I don't expect it's the cause of your issue, but you could try to revert
it to confirm.
Instead I think what's going on is that they have their design expecting
that Windows does a "dark screen wakeup". This is where it exits a
hardware sleep state but doesn't fully wake the system. If no input
activity happens then it goes back to hardware sleep.
This is something that common userspace (systemd on most systems)
doesn't support today.
One option for you is to try to set this GPIO not to be a wake source by
gpiolib_acpi.ignore_wake=AMDI0030:00@0.
If this helps, please also check whether this breaks power button wakeup
though. If it does we might be trading one wakeup source for another if
they're muxed.
[1]
https://github.com/torvalds/linux/commit/8ff4fb276e2384a87ae7f65f3c28e1e139dbb3fe
^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <vVnKVxELkDdxFLiNbtGhT9X7GA_OV3Wk7q6YB_K4Qz3N8Dfp-MCcZqeobEP8dX-H4kjqKzYqyloahoaxB6ZEp8l9XgkIrD8S27Ertjwq324=@proton.me>]
* Fw: Re: [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups
[not found] ` <vVnKVxELkDdxFLiNbtGhT9X7GA_OV3Wk7q6YB_K4Qz3N8Dfp-MCcZqeobEP8dX-H4kjqKzYqyloahoaxB6ZEp8l9XgkIrD8S27Ertjwq324=@proton.me>
@ 2025-09-04 6:08 ` aprilgrimoire
0 siblings, 0 replies; 11+ messages in thread
From: aprilgrimoire @ 2025-09-04 6:08 UTC (permalink / raw)
To: linux-pm@vger.kernel.org
Sent with Proton Mail secure email.
------- Forwarded Message -------
From: aprilgrimoire <aprilgrimoire@proton.me>
Date: On Thursday, September 4th, 2025 at 2:07 PM
Subject: Re: [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups
To: Mario Limonciello <superm1@kernel.org>
> > IRQ1 doesn't show up in this report, so this is not a problem with the
> > keyboard wakeup.
> >
> > There's a few things that stand out to me.
> >
> > 1) There are ACPI errors with the PEP _DSM; specificially the screen on
> > action. This isn't likely the cause of this issue but it's most
> > definitely a BIOS bug.
> >
> > ACPI BIOS Error (bug): Could not resolve symbol [\_SB.ACDC.RTAC],
> > AE_NOT_FOUND (20250404/psargs-332)
> > ACPI Error: Aborting method \_SB.PEP.DSM due to previous error
> > (AE_NOT_FOUND) (20250404/psparse-529)
> > ACPI: \SB.PEP: Failed to transitioned to state screen on
> >
> > 2) The wakeup is from IRQ 7 (like you said) which is the GPIO controller.
> > PM: Triggering wakeup from IRQ 7
> > Woke up from IRQ 7 (IR-IO-APIC 7-fasteoi pinctrl_amd)
> >
> > The GPIO controller wakes up the system when any of the pins that are
> > marked as wake pins are triggered. In your case this is GPIO 0.
> > GPIO 0 is active: 0x38157800
> >
> > According to the SSDT _EVT handler this notifies the _PWRB ACPI object.
> >
> > Case (Zero)
> > {
> > M000 (0x3900)
> > Notify (\_SB.PWRB, 0x80) // Status Change
> > }
> >
> > We can see that notify happened here:
> > Dispatching Notify on [PWRB] (Device) Value 0x80 (Status Change)
> >
> > So based on above what it looks like is going on to me is that the lid
> > is likely indirectly tied to GPIO 0 in this design. It's not clear if
> > it's a mux, directly connected or if the EC drives that GPIO or what not.
> >
> > It's worth noting that we did have a Linux kernel change to turn off
> > debounce for all GPIOs recently at suspend time [1]. You can see in
> > your log this message associated with it.
> >
> > Clearing debounce for GPIO #0 during suspend.
> >
> > I don't expect it's the cause of your issue, but you could try to revert
> > it to confirm.
> >
> > Instead I think what's going on is that they have their design expecting
> > that Windows does a "dark screen wakeup". This is where it exits a
> > hardware sleep state but doesn't fully wake the system. If no input
> > activity happens then it goes back to hardware sleep.
> >
> > This is something that common userspace (systemd on most systems)
> > doesn't support today.
> >
> > One option for you is to try to set this GPIO not to be a wake source by
> > gpiolib_acpi.ignore_wake=AMDI0030:00@0.
> >
> > If this helps, please also check whether this breaks power button wakeup
> > though. If it does we might be trading one wakeup source for another if
> > they're muxed.
> >
> > [1]
> > https://github.com/torvalds/linux/commit/8ff4fb276e2384a87ae7f65f3c28e1e139dbb3fe
>
>
> Hi, Mario!
>
> I tested clearing debounce, and it didn't make a difference.
>
> The gpiolib_acpi.ignore_wake option worked!
>
> It seemed that IRQ 1 is just a regular device, with wake up settable via udev. Even without the kernel modification, gpiolib_acpi.ignore_wake alone could stop the lid from waking the system up.
>
> It seems this quirk should not be applied here: The lid triggers two events, one from IRQ1 and another from IRQ7. The kernel cmdline option can disable the IRQ7 signal from waking the system up, and the IRQ1 event can be disabled by either
>
> 1. Enabling the quirk
> 2. Setting ACTION=="add", SUBSYSTEM=="input", ATTR{name}=="Lid Switch", ATTR{inhibited}="1"
> in udev
>
> The problem is, the quirk also stops other on-laptop methods from waking the system up: builtin keyboard, builtin touchpad and power button, none of those would work with the quirk enabled. With the udev workaround, the lid event can be disabled, and I can still wake up with the builtin keyboard.
>
> Thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <lyy4riGTLOpvYTPUeUx6krjnYdeE8iYbWRrLOJLOChOKMcys00nhNWJ_JD8V8kkVQk87ktMK8w7BAEosOs3KGipyHlvkvQ0_j6cipUfxYtA=@proton.me>]
end of thread, other threads:[~2025-09-05 18:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 16:23 [BUG] MECHREVO Yilong15Pro GM5HG7A: lid switch causing unwanted s2idle wakeups aprilgrimoire
2025-09-03 16:50 ` Mario Limonciello
2025-09-03 17:13 ` aprilgrimoire
2025-09-03 17:32 ` Mario Limonciello
[not found] ` <vVnKVxELkDdxFLiNbtGhT9X7GA_OV3Wk7q6YB_K4Qz3N8Dfp-MCcZqeobEP8dX-H4kjqKzYqyloahoaxB6ZEp8l9XgkIrD8S27Ertjwq324=@proton.me>
2025-09-04 6:08 ` Fw: " aprilgrimoire
[not found] ` <lyy4riGTLOpvYTPUeUx6krjnYdeE8iYbWRrLOJLOChOKMcys00nhNWJ_JD8V8kkVQk87ktMK8w7BAEosOs3KGipyHlvkvQ0_j6cipUfxYtA=@proton.me>
[not found] ` <0fb5a890-63f0-412b-8d88-79b40e2c564b@kernel.org>
2025-09-04 7:38 ` aprilgrimoire
2025-09-04 15:08 ` Mario Limonciello
2025-09-04 16:34 ` aprilgrimoire
2025-09-04 17:47 ` Mario Limonciello
2025-09-05 2:51 ` aprilgrimoire
2025-09-05 18:03 ` Mario Limonciello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).