linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

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).