Bug 1222345 - Laptop wakes from suspend once the user closes the lid
Summary: Laptop wakes from suspend once the user closes the lid
Status: REOPENED
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Kernel (show other bugs)
Version: Leap 15.5
Hardware: Other Other
: P5 - None : Normal with 4 votes (vote)
Target Milestone: ---
Assignee: openSUSE Kernel Bugs
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-05 00:11 UTC by Tristan Miller
Modified: 2024-05-02 12:31 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2024-04-05 00:11:09 UTC
I have a ThinkPad T14 Gen 4, which has an AMD Ryzen 7 PRO 7840U.  With kernel-default 6.8.4-rc1, the computer can be suspended when the lid is open, but it wakes up as soon as the user closes the lid.  The problem does not occur with kernel-default 5.14.21.
Comment 1 Takashi Iwai 2024-04-05 08:01:08 UTC
This didn't happen with 6.7.x, right?  I guess it's a regression in the recent upstream.
Comment 2 Tristan Miller 2024-04-05 13:48:15 UTC
I don't know; I didn't try 6.7.x.  I tried only 5.14.21, which is the current stable kernel for Leap 15.5, and 6.8.4-rc1, which is the current kernel available in backports.  (I wanted to upgrade from 5.14.21 because that version has a different suspend problem where, about 10% of the time, the computer locks up or reboots when waking from suspend.)

I can try 6.7.x if you tell me where to find a Leap 15.5 package, or where to find the project on the build service so that I can build one myself.  I found 6.8.4-rc1 in the repository <https://build.opensuse.org/package/show/Kernel:stable:Backport/kernel-source> but it has only one revision in the history.
Comment 3 Takashi Iwai 2024-04-05 13:56:53 UTC
You can find in my OBS repo, e.g.
  http://download.opensuse.org/repositories/home:/tiwai:/kernel:/6.7/backport/

Also, try Leap 15.6 kernel.
  http://download.opensuse.org/repositories/Kernel:/SLE15-SP6/pool/

This should work stably without surprises.
Comment 4 Tristan Miller 2024-04-05 16:05:05 UTC
The problem is also reproducible with 6.7.9 from your repository and 6.4.0 from the 15.6 repository.  But strangely, when I downgrade kernel-default back to 5.14.21, or even boot into a read-only snapshot with that kernel, the problem is still reproducible!  I'm not sure what to make of this.

In any event, it would be nice if I could use any kernel version that keeps the laptop suspended when I close the lid.
Comment 5 Tristan Miller 2024-04-05 21:08:00 UTC
I found a kernel bug report for the same issue with another model of ThinkPad: https://bugzilla.kernel.org/show_bug.cgi?id=214855

That bug report indicates that the issue was fixed with 5.16.  So I installed 5.16 from <http://download.opensuse.org/repositories/home:/tiwai:/kernel:/5.16/backport/x86_64/> was no longer able to reproduce the problem.

I rebooted again, this time to 6.8.4-rc1, and I still can't reproduce the problem.

Perhaps the bug is there in all the kernel versions I've tested, but is not always reproducible.
Comment 6 Takashi Iwai 2024-04-06 08:48:25 UTC
Yes, it looks so; it's likely a problem triggered by BIOS setup or such, which had been changed accidentally.

Feel free to reopen if the issue is reproduced.
Comment 7 Tristan Miller 2024-04-06 13:13:25 UTC
Yes, I've rebooted (still using 6.8.4-rc1) and the problem occurs again.  I suspect that the kernel version may have nothing to do with this bug.  Rather, each time the computer is rebooted, it somehow decides whether or not closing the lid will wake from suspend, and it maintains this behaviour at least until the next reboot.
Comment 8 Takashi Iwai 2024-04-06 18:02:29 UTC
Then some spurious interrupt must be waking up the machine.
Please check the following:

- Enable/disable LID ACPI:
  To check the status:
    % cat /proc/acpi/wakeup
  To toggle the status:
    % echo LID > /proc/acpi/wakeup

If this doesn't influence, it's something else than ACPI wakeup.

Then, you can try the direct suspend by
  echo mem > /sys/power/state
Does it behave differently?
Comment 9 Tristan Miller 2024-04-15 20:12:40 UTC
I tried toggling the lid wakeup as you suggested.  No matter whether it shows as enabled or disabled in /proc/acpi/wakeup, and no matter whether I put the laptop to sleep using the KDE Plasma GUI or with "echo mem > /sys/power/state", the laptop wakes up once I close the lid.

I don't see any settings in the BIOS menu that seem relevant.

Is there anything else I can try?
Comment 10 Takashi Iwai 2024-04-18 16:11:00 UTC
The best would be to report your issue to the upstream devs, I suppose.
Comment 11 Tristan Miller 2024-04-18 20:11:28 UTC
Do you mean the kernel maintainers, or the hardware manufacturer?
Comment 12 Takashi Iwai 2024-04-19 08:22:47 UTC
The former.
Comment 13 Jiri Slaby 2024-04-30 10:33:36 UTC
It is usually the touchpad. Was in my case (T14s and P14s) too.

https://wiki.archlinux.org/title/Lenovo_ThinkPad_T14s_(AMD)_Gen_3#Disable_wakeup_from_sleep_on_touchpad_activity
Comment 14 Takashi Iwai 2024-04-30 11:37:41 UTC
(In reply to Jiri Slaby from comment #13)
> It is usually the touchpad. Was in my case (T14s and P14s) too.
> 
> https://wiki.archlinux.org/title/
> Lenovo_ThinkPad_T14s_(AMD)_Gen_3#Disable_wakeup_from_sleep_on_touchpad_activi
> ty

Do you mean that it can be touchpad that incorrectly wakes up at the lid close?

My T14s gen 3 doesn't seem showing the problem by some reason.
Comment 15 Jiri Slaby 2024-05-02 11:42:18 UTC
(In reply to Takashi Iwai from comment #14)
> (In reply to Jiri Slaby from comment #13)
> > It is usually the touchpad. Was in my case (T14s and P14s) too.
> > 
> > https://wiki.archlinux.org/title/
> > Lenovo_ThinkPad_T14s_(AMD)_Gen_3#Disable_wakeup_from_sleep_on_touchpad_activi
> > ty
> 
> Do you mean that it can be touchpad that incorrectly wakes up at the lid
> close?

Yes, the lid generates some "touches" when getting close to the touchpad.
Comment 16 Takashi Iwai 2024-05-02 12:31:53 UTC
Ah interesting.  Tristan, could you check whether the workaround mentioned for Arch works for you, too?