Laptop wakes up from sleep when lid is closed if mouse is moved

Bug #1998964 reported by Sami Pietila
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
Opinion
Undecided
Unassigned

Bug Description

When laptop lid is closed the system goes to sleep, but wakes up if mouse is moved even if lid is still closed.

ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: xorg 1:7.7+23ubuntu2
Uname: Linux 5.18.19-051819-generic x86_64
ApportVersion: 2.23.1-0ubuntu3
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: pass
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Tue Dec 6 22:59:20 2022
DistUpgraded: 2022-10-24 14:48:02,231 DEBUG Running PostInstallScript: '/usr/lib/ubuntu-advantage/upgrade_lts_contract.py'
DistroCodename: kinetic
DistroVariant: ubuntu
EcryptfsInUse: Yes
ExtraDebuggingInterest: Yes, if not too technical
GraphicsCard:
 Subsystem: ASUSTeK Computer Inc. Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M] [1043:16c2]
 Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c4) (prog-if 00 [VGA controller])
   Subsystem: ASUSTeK Computer Inc. Cezanne [1043:16c2]
InstallationDate: Installed on 2021-10-12 (420 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Daily amd64 (20211010)
MachineType: ASUSTeK COMPUTER INC. ROG Strix G513QY_G513QY
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.18.19-051819-generic root=UUID=ff964c9b-ce92-4334-8759-9d785a262c60 ro rootflags=subvol=@ quiet splash i8042.reset vt.handoff=7
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: xorg
Symptom: display
UpgradeStatus: Upgraded to kinetic on 2022-10-24 (43 days ago)
dmi.bios.date: 03/29/2022
dmi.bios.release: 5.19
dmi.bios.vendor: American Megatrends International, LLC.
dmi.bios.version: G513QY.318
dmi.board.asset.tag: ATN12345678901234567
dmi.board.name: G513QY
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: 1.0
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK COMPUTER INC.
dmi.chassis.version: 1.0
dmi.ec.firmware.release: 0.81
dmi.modalias: dmi:bvnAmericanMegatrendsInternational,LLC.:bvrG513QY.318:bd03/29/2022:br5.19:efr0.81:svnASUSTeKCOMPUTERINC.:pnROGStrixG513QY_G513QY:pvr1.0:rvnASUSTeKCOMPUTERINC.:rnG513QY:rvr1.0:cvnASUSTeKCOMPUTERINC.:ct10:cvr1.0:sku:
dmi.product.family: ROG Strix
dmi.product.name: ROG Strix G513QY_G513QY
dmi.product.version: 1.0
dmi.sys.vendor: ASUSTeK COMPUTER INC.
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.113-2
version.libgl1-mesa-dri: libgl1-mesa-dri 22.2.1-1ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx 22.2.1-1ubuntu1
version.xserver-xorg-core: xserver-xorg-core 2:21.1.4-2ubuntu1.1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-3
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20210115-1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-2build1

Revision history for this message
Sami Pietila (sampie) wrote :
Revision history for this message
Sami Pietila (sampie) wrote :

I don't know which package this problem involves. But I guess this problem can be easily reproduced with multiple different machines running Ubuntu.

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

Understandably waking up is annoying in this case but if you had an external monitor and keyboard plugged in then waking up on mouse movement would be the right thing to do.

To block USB from waking the system up I would try:

  sudo sh -c "echo XHCI > /proc/acpi/wakeup"

affects: xorg (Ubuntu) → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon (Ubuntu):
status: New → Opinion
Revision history for this message
Sami Pietila (sampie) wrote :

Agreed that the behavior should be dependent on the existence of external display and keyboard where the current behavior would make sense.

I tried how Windows 11 behaves and it did not seem to wake up on mouse events when laptop lid is closed.

This did not seem to change the behavior:
sudo sh -c "echo XHCI > /proc/acpi/wakeup"

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

Can you attach a copy of /proc/acpi/wakeup and confirm the type of mouse connected?

Revision history for this message
Sami Pietila (sampie) wrote :

Sure.

$ cat /proc/acpi/wakeup
Device S-state Status Sysfs node
GPP0 S4 *enabled pci:0000:00:01.1
SWUS S4 *enabled pci:0000:01:00.0
SWDS S4 *enabled pci:0000:02:00.0
GP17 S4 *enabled pci:0000:00:08.1

The mouse is Logitech G305.

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

That's unusual. Your BIOS doesn't seem to offer any ability to control USB wakeups. Maybe it uses something different to ACPI?

affects: gnome-settings-daemon (Ubuntu) → ubuntu
Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Try looking in the BIOS for options that control wakeups. Other than that I can only suggest unplugging the mouse before closing the laptop.

Implementing the same behaviour as Windows 11 is of course possible, but non-trivial and unlikely to happen soon. I'm not even sure which software package to assign this to. I can't assign it to the kernel because you're not using a supported Ubuntu kernel.

Revision history for this message
Sami Pietila (sampie) wrote :

I am not very familiar with power control, can't say if the laptop uses ACPI or something else. The laptop is ROG Strix G513QY_G513QY manufactured by ASUS. I don't think I have seen anything in the BIOS menu that looks like wakeup control options. Generally, the BIOS does not seem to have a good selection of option, only a few.

I am using a mainline kernel, because the official Ubuntu kernel can put the laptop to sleep, but not wake it up. With the official kernel, if I put the laptop to sleep by closing the lid, the display stays off when I open the lid. After that the only thing that helps is to press power button long enough to shut down the machine and then restart it.

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

You might want to try:

* The Ubuntu kernel but also add the workaround mentioned in bug 1968040.

* A newer mainline kernel in case there is one that fixes both bugs, like https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.0.9/amd64/

Revision history for this message
Sami Pietila (sampie) wrote (last edit ):

Thank you. I did apply the workaround from bug 1968040 and switched to Ubuntu kernel 5.19.0-26-generic.

Concerning the sleep, this kernel behaves identically to the previous mainline one.

$ cat /proc/acpi/wakeup
Device S-state Status Sysfs node
GPP0 S4 *enabled pci:0000:00:01.1
SWUS S4 *enabled pci:0000:01:00.0
SWDS S4 *enabled pci:0000:02:00.0
GP17 S4 *enabled pci:0000:00:08.1

Revision history for this message
Sami Pietila (sampie) wrote :
Download full text (3.6 KiB)

t looks like Ubuntu default kernel does not work after all. While using
desktop the machine suddenly freezes and computer has to be shut down
from power button and restarted. However, I could log in from another machine by using ssh and saw that dmesg is showing lots of these messages:

[ 6834.800344] amdgpu 0000:08:00.0: amdgpu: [mmhub0] no-retry page fault (src_id:0 ring:40 vmid:2 pasid:32775, for process slack pid 5378 thread slack:cs0 pid 5441)
[ 6834.800351] amdgpu 0000:08:00.0: amdgpu: in page starting at address 0x0000800106bf0000 from IH client 0x12 (VMC)
[ 6834.800355] amdgpu 0000:08:00.0: amdgpu: VM_L2_PROTECTION_FAULT_STATUS:0x00240051
[ 6834.800356] amdgpu 0000:08:00.0: amdgpu: Faulty UTCL2 client ID: MP1 (0x0)
[ 6834.800358] amdgpu 0000:08:00.0: amdgpu: MORE_FAULTS: 0x1
[ 6834.800359] amdgpu 0000:08:00.0: amdgpu: WALKER_ERROR: 0x0
[ 6834.800359] amdgpu 0000:08:00.0: amdgpu: PERMISSION_FAULTS: 0x5
[ 6834.800360] amdgpu 0000:08:00.0: amdgpu: MAPPING_ERROR: 0x0
[ 6834.800361] amdgpu 0000:08:00.0: amdgpu: RW: 0x1
[ 6834.800362] amdgpu 0000:08:00.0: amdgpu: [mmhub0] no-retry page fault (src_id:0 ring:40 vmid:2 pasid:32775, for process slack pid 5378 thread slack:cs0 pid 5441)
[ 6834.800364] amdgpu 0000:08:00.0: amdgpu: in page starting at address 0x0000800106bf1000 from IH client 0x12 (VMC)
[ 6834.800373] amdgpu 0000:08:00.0: amdgpu: VM_L2_PROTECTION_FAULT_STATUS:0x00240051
[ 6834.800374] amdgpu 0000:08:00.0: amdgpu: Faulty UTCL2 client ID: MP1 (0x0)
[ 6834.800375] amdgpu 0000:08:00.0: amdgpu: MORE_FAULTS: 0x1
[ 6834.800376] amdgpu 0000:08:00.0: amdgpu: WALKER_ERROR: 0x0
[ 6834.800376] amdgpu 0000:08:00.0: amdgpu: PERMISSION_FAULTS: 0x5
[ 6834.800377] amdgpu 0000:08:00.0: amdgpu: MAPPING_ERROR: 0x0
[ 6834.800378] amdgpu 0000:08:00.0: amdgpu: RW: 0x1
[ 6834.800379] amdgpu 0000:08:00.0: amdgpu: [mmhub0] no-retry page fault (src_id:0 ring:40 vmid:2 pasid:32775, for process slack pid 5378 thread slack:cs0 pid 5441)
[ 6834.800380] amdgpu 0000:08:00.0: amdgpu: in page starting at address 0x0000800106bf2000 from IH client 0x12 (VMC)
[ 6834.800382] amdgpu 0000:08:00.0: amdgpu: VM_L2_PROTECTION_FAULT_STATUS:0x00000000
[ 6834.800383] amdgpu 0000:08:00.0: amdgpu: Faulty UTCL2 client ID: MP1 (0x0)
[ 6834.800384] amdgpu 0000:08:00.0: amdgpu: MORE_FAULTS: 0x0
[ 6834.800385] amdgpu 0000:08:00.0: amdgpu: WALKER_ERROR: 0x0
[ 6834.800386] amdgpu 0000:08:00.0: amdgpu: PERMISSION_FAULTS: 0x0
[ 6834.800386] amdgpu 0000:08:00.0: amdgpu: MAPPING_ERROR: 0x0
[ 6834.800387] amdgpu 0000:08:00.0: amdgpu: RW: 0x0
[ 6834.800388] amdgpu 0000:08:00.0: amdgpu: [mmhub0] no-retry page fault (src_id:0 ring:40 vmid:2 pasid:32775, for process slack pid 5378 thread slack:cs0 pid 5441)
[ 6834.800389] amdgpu 0000:08:00.0: amdgpu: in page starting at address 0x0000800106bf3000 from IH client 0x12 (VMC)
[ 6834.800391] amdgpu 0000:08:00.0: amdgpu: VM_L2_PROTECTION_FAULT_STATUS:0x00000000
[ 6834.800392] amdgpu 0000:08:00.0: amdgpu: Faulty UTCL2 client ID: MP1 (0x0)
[ 6834.800393] amdgpu 0000:08:00.0: amdgpu: MORE_FAULTS: 0x0
[ 6834.800394] amdgpu 0000:08:00.0: amdgpu: ...

Read more...

Revision history for this message
Sami Pietila (sampie) wrote :

Full dmesg output.

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

To avoid confusion, please open a new bug to track the above kernel error by running:

  ubuntu-bug linux

Revision history for this message
Sami Pietila (sampie) wrote :

>To avoid confusion, please open a new bug to track the above kernel error by running:
> ubuntu-bug linux

I have tried that. Unfortunately, it does not work. Launchpad refresh phase never completes. I have tried multiple times.

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

OK, worst case you can use this link to create a new kernel bug:

https://bugs.launchpad.net/ubuntu/+source/linux/+filebug

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.