[Lenovo ThinkPad E580] System doesn't wake up after locking, unless a USB mouse is installed

Bug #1977977 reported by popov895
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned
linux-oem-5.17 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

After I lock my screen and let it blank, moving the mouse or pressing any key on the keyboard won't wake it up. Pressing Ctrl+Alt+F1 doesn't help.

That's on a fully up-to-date Ubuntu 22.04 (GNOME 42.1, Wayland).

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: gdm3 42.0-1ubuntu7
ProcVersionSignature: Ubuntu 5.15.0-37.39-generic 5.15.35
Uname: Linux 5.15.0-37-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed Jun 8 16:30:14 2022
InstallationDate: Installed on 2022-06-08 (0 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
SourcePackage: gdm3
UpgradeStatus: No upgrade log present (probably fresh install)
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: toquza 1742 F.... pulseaudio
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 22.04
InstallationDate: Installed on 2022-06-17 (2 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 004: ID 06cb:00a2 Synaptics, Inc. Metallica MOH Touch Fingerprint Reader
 Bus 001 Device 003: ID 04f2:b604 Chicony Electronics Co., Ltd Integrated Camera (1280x720@30)
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Lsusb-t:
 /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
 /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
     |__ Port 6: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
     |__ Port 6: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
     |__ Port 8: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 12M
MachineType: LENOVO 20KS0065RT
Package: linux (not installed)
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.17.0-1011-oem root=UUID=5967a0e0-f501-49e3-9bfd-5f12681137c5 ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 5.17.0-1011.12-oem 5.17.9
RelatedPackageVersions:
 linux-restricted-modules-5.17.0-1011-oem N/A
 linux-backports-modules-5.17.0-1011-oem N/A
 linux-firmware 20220329.git681281e4-0ubuntu3.2
Tags: wayland-session jammy
Uname: Linux 5.17.0-1011-oem x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 04/29/2021
dmi.bios.release: 1.45
dmi.bios.vendor: LENOVO
dmi.bios.version: R0PET68W (1.45 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20KS0065RT
dmi.board.vendor: LENOVO
dmi.board.version: Not Defined
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.ec.firmware.release: 1.45
dmi.modalias: dmi:bvnLENOVO:bvrR0PET68W(1.45):bd04/29/2021:br1.45:efr1.45:svnLENOVO:pn20KS0065RT:pvrThinkPadE580:rvnLENOVO:rn20KS0065RT:rvrNotDefined:cvnLENOVO:ct10:cvrNone:skuLENOVO_MT_20KS_BU_Think_FM_ThinkPadE580:
dmi.product.family: ThinkPad E580
dmi.product.name: 20KS0065RT
dmi.product.sku: LENOVO_MT_20KS_BU_Think_FM_ThinkPad E580
dmi.product.version: ThinkPad E580
dmi.sys.vendor: LENOVO

Revision history for this message
popov895 (popov895) wrote :
Revision history for this message
popov895 (popov895) wrote :

Disabling DPMS (using command "xset -dpms") fixes this issue on X11, but I haven't found a workaround on Wayland.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report.

Firstly please check for crashes by following these steps:

  https://wiki.ubuntu.com/Bugs/Responses#Missing_a_crash_report_or_having_a_.crash_attachment

In a Wayland session it is only crashes of 'gnome-shell' that are relevant here.

Secondly, next time the problem happens please:

1. Wait 10 seconds.

2. Reboot.

3. Run: journalctl -b-1 > prevboot.txt

4. Attach the resulting text file here.

affects: gdm3 (Ubuntu) → ubuntu
Changed in ubuntu:
status: New → Incomplete
affects: ubuntu → gnome-shell (Ubuntu)
Revision history for this message
popov895 (popov895) wrote :
Revision history for this message
popov895 (popov895) wrote (last edit ):

Also, disabling DPMS solved the issue for me where my laptop couldn't properly suspend/resume. I guess these issues are related.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. The Xorg session in comment #4 doesn't appear to have crashed. Maybe it was just frozen.

Please repeat the above steps with a Wayland session and also remember to follow https://wiki.ubuntu.com/Bugs/Responses#Missing_a_crash_report_or_having_a_.crash_attachment

Revision history for this message
popov895 (popov895) wrote (last edit ):

The /var/crash folder is empty, there are no fresh logs at https://errors.ubuntu.com/user/ID.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. Looks like you were only logged in for 2 seconds before the log ends. Is that right, you just locked the screen immediately?

Also do you have any external monitors connected?

Next please try adding this to /etc/environment:

  MUTTER_DEBUG_ENABLE_ATOMIC_KMS=0

and then reboot and log into Wayland again. Any improvement?

Revision history for this message
popov895 (popov895) wrote :

I was wrong, disabling DPMS didn't fix the suspend issue. So these problems are most likely unrelated.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If a bug is common to Xorg and Wayland sessions then that often means it's in the kernel, or in the hardware. Let's assume that's not yet true and please follow the instructions in comment #8.

Revision history for this message
popov895 (popov895) wrote :

> Looks like you were only logged in for 2 seconds before the log ends. Is that right, you just locked the screen immediately?

Yes, that's right.

> Also do you have any external monitors connected?

No.

> MUTTER_DEBUG_ENABLE_ATOMIC_KMS=0
> Any improvement?

Nothing changed.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, the final thing to try is to replace the above environment variable with:

  MUTTER_DEBUG=kms

then reboot, reproduce the hang in a Wayland session, reboot again and run:

  journalctl -b-1 > kmsdebug.txt

and attach the resulting text file here.

That will tell us if gnome-shell is sending the right instructions to the kernel to sleep/wake the screen. If it is then this is no longer a gnome-shell/mutter bug.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Another possibility is that you have excessively deep sleep enabled on too many devices (like if 'tlp' is installed) and some machines can't wake up from that. Make sure you don't have tlp installed and also try adding a USB mouse to wake the machine up with - you can also then see if the mouse is powered when trying to wake the system.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Out of curiosity, what package owns /etc/systemd/system/disable-wakeup-on-lid-switch.service ?

Revision history for this message
popov895 (popov895) wrote :

Adding MUTTER_DEBUG_ENABLE_ATOMIC_KMS=0 and disabling disable-wakeup-on-lid-switch.service did the trick for me! Thanks!

> Out of curiosity, what package owns /etc/systemd/system/disable-wakeup-on-lid-switch.service ?

It's a self-written service that blocks the laptop from waking up when the lid is opened.

Revision history for this message
popov895 (popov895) wrote :

Happened again :(

Revision history for this message
popov895 (popov895) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

kmsdebug.txt ends with the screen drawing normally and successfully. Did you see anything on screen or did it appear to be off?

Revision history for this message
popov895 (popov895) wrote :

The screen remained blank. II want to clarify that "blank screen" doesn't just mean that it's black, but also powered off. On X11 I found a workaround by disabling DPMS (in this case, "blank screen" means it's just black, not powered off).

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Either the log in comment #17 is not from when the screen was blank/black/off, or it was and the monitor/driver is faulty. Because the kernel seems to be reporting that the screen is successfully displaying new frames. If it's doing that but you can't see an image then it's a problem in the kernel or in the monitor itself.

I think it's more likely that the log in comment #17 is just not from a time when the screen was blank.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

When a monitor turns off you will get a log message that contains:

  property 'ACTIVE' (22) to 0

which is not mentioned in the log of comment #17. So indeed that log is not from a time when the monitor was turned off via software.

Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Did you forget the "Wait 10 seconds" step maybe? See comment #3.

Revision history for this message
popov895 (popov895) wrote :
Revision history for this message
popov895 (popov895) wrote :
Revision history for this message
popov895 (popov895) wrote :

Connected USB mouse did the trick! I just noticed that I can only wake up the screen if a USB mouse is connected.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK then it sounds like a kernel configuration problem where the system is sleeping some components too deeply to wake up.

Do you have 'tlp' installed? If so then it's a tlp bug/feature. Just uninstall tlp.

If you don't have 'tlp' installed then you can still tweak which system components are able to wake the machine up in /proc/acpi/wakeup but it's very cryptic to use. Can you provide output from 'lspci' and a copy of your /proc/acpi/wakeup file?

summary: - Blanked screen doesn't wake up after locking
+ Blanked screen doesn't wake up after locking, unless a USB mouse is
+ installed
affects: gnome-shell (Ubuntu) → linux (Ubuntu)
summary: - Blanked screen doesn't wake up after locking, unless a USB mouse is
- installed
+ [Lenovo ThinkPad E580] Blanked screen doesn't wake up after locking,
+ unless a USB mouse is installed
summary: - [Lenovo ThinkPad E580] Blanked screen doesn't wake up after locking,
- unless a USB mouse is installed
+ [Lenovo ThinkPad E580] System doesn't wake up after locking, unless a
+ USB mouse is installed
Revision history for this message
popov895 (popov895) wrote :

> OK then it sounds like a kernel configuration problem where the system is sleeping some components too deeply to wake up.

Yes, it may be a kernel configuration problem, as I can' t reproduce this issue on a Ubuntu 22.04 live image, and I didn't have it before Ubuntu 22.04 and don't have it now on openSUSE Tumbleweed with KDE and the latest kernel.

> Do you have 'tlp' installed? If so then it's a tlp bug/feature. Just uninstall tlp.

Yes, I have TLP installed, but I masked it (but not uninstalled) and it had no effect. Also, I mentioned earlier that I didn't have this issue before Ubuntu 22.04 and don't have it now on other distros.

> Can you provide output from 'lspci' and a copy of your /proc/acpi/wakeup file?

I had to switch from Ubuntu to another distro, so I can't provide the contents of this file just yet. Let the bug report be open, I plan to return to Ubuntu with the first corrective release (22.04.1) and if the issue persists, I will provide additional information.

Thank you so much for helping me solve this issue!

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I strongly recommend uninstalling TLP as it often causes bugs like this. If a bug is caused by TLP then it is not supported by Ubuntu and we should not be spending time on it.

Ubuntu 22.04.1 is due for release on 4 August. And if no further comments are added to this bug then it will close automatically around 12 August.

Revision history for this message
popov895 (popov895) wrote :

Okay, let's get back to this issue. I just did a clean installation of Ubuntu 22.04 without the TLP service. The issue still exists, so the cause is not the TLP.

Revision history for this message
popov895 (popov895) wrote :
Revision history for this message
popov895 (popov895) wrote :

Hmm, looks like masking upower.service solved this issue for me: now I can wake up after locking, but gsd-power crashes (`gsd-power crashed with SIGSERV in up_client_get_devices2()`). So, it seems that the problem is in the upower.

Revision history for this message
popov895 (popov895) wrote :

Indeed, stopping upower (`sudo systemctl stop upower.service`) before locking the screen allows me to wake up later without problems.

Revision history for this message
popov895 (popov895) wrote (last edit ):

Finally fixed this issue by installing the linux-oem-22.04 package, which installs kernel 5.17.0.

Changed in linux (Ubuntu):
status: Incomplete → New
Changed in linux-oem-5.17 (Ubuntu):
status: New → Fix Released
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1977977

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
popov895 (popov895) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
popov895 (popov895) wrote : CRDA.txt

apport information

Revision history for this message
popov895 (popov895) wrote : CurrentDmesg.txt

apport information

Revision history for this message
popov895 (popov895) wrote : IwConfig.txt

apport information

Revision history for this message
popov895 (popov895) wrote : Lspci.txt

apport information

Revision history for this message
popov895 (popov895) wrote : Lspci-vt.txt

apport information

Revision history for this message
popov895 (popov895) wrote : Lsusb-v.txt

apport information

Revision history for this message
popov895 (popov895) wrote : PaInfo.txt

apport information

Revision history for this message
popov895 (popov895) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
popov895 (popov895) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
popov895 (popov895) wrote : ProcEnviron.txt

apport information

Revision history for this message
popov895 (popov895) wrote : ProcInterrupts.txt

apport information

Revision history for this message
popov895 (popov895) wrote : ProcModules.txt

apport information

Revision history for this message
popov895 (popov895) wrote : PulseList.txt

apport information

Revision history for this message
popov895 (popov895) wrote : RfKill.txt

apport information

Revision history for this message
popov895 (popov895) wrote : UdevDb.txt

apport information

Revision history for this message
popov895 (popov895) wrote : WifiSyslog.txt

apport information

Revision history for this message
popov895 (popov895) wrote : acpidump.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
To post a comment you must log in.