PC immediatelly starts up after suspend

Hi, i am experiencing a suspend issue and was hoping i could get some help here.

The issue is after i put the PC on suspend, immediately wakes up.
This has been tested with different hardware (motherboard, cpu, gpu) and different desktop environment.

I am running proprietary nvidia driver and running the DE on my discrete gpu.

This issue persisted from kernel version 6.8 (didn’t test before that).

Here is some more info about my system:

System:
  Kernel: 6.9.5-200.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.41-37.fc40
  Desktop: Hyprland v: N/A dm: GDM Distro: Fedora Linux 40 (Workstation
    Edition)
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: ROG STRIX X670E-F GAMING WIFI v: Rev 1.xx
    serial: <superuser required> part-nu: SKU UEFI: American Megatrends v: 1905
    date: 02/05/2024
CPU:
  Info: 16-core model: AMD Ryzen 9 7950X3D bits: 64 type: MT MCP arch: Zen 4
    rev: 2 cache: L1: 1024 KiB L2: 16 MiB L3: 128 MiB
  Speed (MHz): avg: 893 high: 3833 min/max: 400/5759 cores: 1: 3639 2: 3833
    3: 400 4: 3560 5: 3172 6: 400 7: 400 8: 400 9: 3597 10: 400 11: 400 12: 400
    13: 400 14: 400 15: 400 16: 400 17: 400 18: 400 19: 400 20: 400 21: 400
    22: 400 23: 400 24: 400 25: 400 26: 400 27: 400 28: 400 29: 400 30: 400
    31: 400 32: 400 bogomips: 268786
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: NVIDIA GA102 [GeForce RTX 3090] vendor: Micro-Star MSI
    driver: nvidia v: 550.90.07 arch: Ampere pcie: speed: 16 GT/s lanes: 16
    ports: active: none off: DP-3,HDMI-A-2 empty: DP-2,DP-4 bus-ID: 01:00.0
    chip-ID: 10de:2204
  Device-2: AMD Raphael vendor: ASUSTeK driver: amdgpu v: kernel
    arch: RDNA-2 pcie: speed: 16 GT/s lanes: 16 ports: active: none
    empty: DP-1,HDMI-A-1,Writeback-1 bus-ID: 13:00.0 chip-ID: 1002:164e
    temp: 39.0 C
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 24.1.0
    compositor: Hyprland driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa dri: radeonsi gpu: nvidia,nvidia-nvswitch
    display-ID: 1
  Monitor-1: DP-3 model: Dell S2721DGF res: 2560x1440 dpi: 109
    diag: 685mm (27")
  Monitor-2: HDMI-A-2 model: VG278 res: 1920x1080 dpi: 82 diag: 686mm (27")
  API: OpenGL v: 4.6.0 vendor: nvidia v: 550.90.07 glx-v: 1.4
    direct-render: yes renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
  Device-1: NVIDIA GA102 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:1aef
  Device-2: AMD Rembrandt Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 13:00.1 chip-ID: 1002:1640
  Device-3: Focusrite-Novation Scarlett Solo (3rd Gen.)
    driver: snd-usb-audio type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
    bus-ID: 1-5:3 chip-ID: 1235:8211
  Device-4: C-Media Stream 800 HD Studio
    driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 1.1 speed: 12 Mb/s
    lanes: 1 bus-ID: 1-6:4 chip-ID: 0d8c:0134
  Device-5: HP HyperX Cloud III Wireless
    driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 2.0 speed: 12 Mb/s
    lanes: 1 bus-ID: 3-2:2 chip-ID: 03f0:05b7
  Device-6: ASUSTek USB Audio driver: hid-generic,snd-usb-audio,usbhid
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 3-6:3 chip-ID: 0b05:1a52
  API: ALSA v: k6.9.5-200.fc40.x86_64 status: kernel-api
  Server-1: JACK v: 1.9.22 status: off
  Server-2: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
Network:
  Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    vendor: Foxconn driver: mt7921e v: kernel pcie: speed: 5 GT/s lanes: 1
    bus-ID: 09:00.0 chip-ID: 14c3:0616
  IF: wlp9s0 state: down mac: <filter>
  Device-2: Intel Ethernet I225-V vendor: ASUSTeK driver: igc v: kernel
    pcie: speed: 5 GT/s lanes: 1 port: N/A bus-ID: 0a:00.0 chip-ID: 8086:15f3
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Foxconn / Hon Hai Wireless_Device driver: btusb v: 0.8 type: USB
    rev: 2.1 speed: 480 Mb/s lanes: 1 bus-ID: 1-9:5 chip-ID: 0489:e0e2
  Report: btmgmt ID: hci0 rfk-id: 2 state: up address: <filter> bt-v: 5.2
    lmp-v: 11
Drives:
  Local Storage: total: 4.09 TiB used: 33.28 GiB (0.8%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 970 EVO Plus 500GB
    size: 465.76 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 45.9 C
  ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 990 PRO 1TB size: 931.51 GiB
    speed: 63.2 Gb/s lanes: 4 serial: <filter> temp: 54.9 C
  ID-3: /dev/sda vendor: Seagate model: ST2000DM008-2FR102 size: 1.82 TiB
    speed: 6.0 Gb/s serial: <filter>
  ID-4: /dev/sdb vendor: Western Digital model: WD10EZEX-00BN5A0
    size: 931.51 GiB speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 464.17 GiB used: 32.75 GiB (7.1%) fs: btrfs
    dev: /dev/nvme0n1p3
  ID-2: /boot size: 973.4 MiB used: 500.4 MiB (51.4%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 598.8 MiB used: 45.8 MiB (7.6%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 464.17 GiB used: 32.75 GiB (7.1%) fs: btrfs
    dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 43.8 C mobo: 42.0 C gpu: amdgpu temp: 39.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 64 GiB available: 62 GiB used: 2.54 GiB (4.1%)
  Processes: 515 Power: uptime: 6m wakeups: 1 Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: pm: flatpak pkgs: 13 Compilers: clang: 18.1.6 gcc: 14.1.1
    Shell: Zsh v: 5.9 running-in: alacritty inxi: 3.3.34

Also this is what i am getting when i run journalctl -b -g suspend

Jun 24 16:15:44 fedora systemd-logind[1494]: The system will suspend now!
Jun 24 16:15:44 fedora ModemManager[1593]: <msg> [sleep-monitor-systemd] system is about to suspend
Jun 24 16:15:44 fedora systemd[1]: Starting nvidia-suspend.service - NVIDIA system suspend actions...
Jun 24 16:15:44 fedora suspend[3305]: nvidia-suspend.service
Jun 24 16:15:44 fedora logger[3305]: <13>Jun 24 16:15:44 suspend: nvidia-suspend.service
Jun 24 16:15:45 fedora systemd[1]: nvidia-suspend.service: Deactivated successfully.
Jun 24 16:15:45 fedora systemd[1]: Finished nvidia-suspend.service - NVIDIA system suspend actions.
Jun 24 16:15:45 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nvidia-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 24 16:15:45 fedora audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nvidia-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 24 16:15:45 fedora systemd[1]: Starting systemd-suspend.service - System Suspend...
Jun 24 16:15:45 fedora systemd-sleep[3352]: Performing sleep operation 'suspend'...
Jun 24 16:15:45 fedora kernel: PM: suspend entry (deep)
Jun 24 16:15:55 fedora kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Jun 24 16:15:55 fedora kernel: queueing ieee80211 work while going to suspend
Jun 24 16:15:55 fedora kernel: PM: suspend devices took 0.617 seconds
Jun 24 16:15:55 fedora kernel: PM: suspend exit
Jun 24 16:15:55 fedora systemd-sleep[3352]: System returned from sleep operation 'suspend'.
Jun 24 16:15:56 fedora systemd[1]: systemd-suspend.service: Deactivated successfully.
Jun 24 16:15:56 fedora systemd[1]: Finished systemd-suspend.service - System Suspend.
Jun 24 16:15:56 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 24 16:15:56 fedora audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-suspend comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 24 16:15:56 fedora systemd[1]: systemd-suspend.service: Consumed 1.297s CPU time.
Jun 24 16:15:56 fedora systemd[1]: Reached target suspend.target - Suspend.
Jun 24 16:15:56 fedora systemd-logind[1494]: Operation 'suspend' finished.
Jun 24 16:15:56 fedora logger[3503]: <13>Jun 24 16:15:56 suspend: nvidia-resume.service
Jun 24 16:15:56 fedora systemd[1]: Stopped target suspend.target - Suspend.

Thank you for your time.

After some investigating i found out that my logitech wireless mouse receiver was the cause of the wake up.

Solution:
https://wiki.archlinux.org/title/Power_management/Wakeup_triggers#Event-driven_with_udev

I used the udev-rule approach and added a rule with my specific vid and pid like this:
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52b", ATTR{power/wakeup}="disabled"

With a little caveat to add ‘changed’ to the action

2 Likes