Suspend problem

Installed on my daily driver desktop, everything works well expect suspend. I sometimes lose USB mouse, system gets unstable and if I plug/unplug the mouse gnome restarts. My BIOS is up to date, supports all required pstate features.

[    0.645225] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
[    5.138357] kvm_amd: TSC scaling supported
[    5.138359] kvm_amd: Nested Virtualization enabled
[    5.138360] kvm_amd: Nested Paging enabled
[    5.138361] kvm_amd: LBR virtualization supported
[    5.138368] kvm_amd: Virtual VMLOAD VMSAVE supported
[    5.138369] kvm_amd: Virtual GIF supported
[    5.138369] kvm_amd: Virtual NMI enabled
[   40.136154] amd_pstate: failed to enable amd pstate during resume, return -6
[   40.138887] amd_pstate: failed to enable amd pstate during resume, return -6
[   40.141553] amd_pstate: failed to enable amd pstate during resume, return -6
[   40.144219] amd_pstate: failed to enable amd pstate during resume, return -6
[   40.146879] amd_pstate: failed to enable amd pstate during resume, return -6
[   40.149497] amd_pstate: failed to enable amd pstate during resume, return -6
[   40.152132] amd_pstate: failed to enable amd pstate during resume, return -6
System:
  Kernel: 6.10.6-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc
  Desktop: GNOME v: 46.4 tk: GTK v: 3.24.43 wm: gnome-shell with: Docker
    tools: gsd-screensaver-proxy dm: GDM v: 46.2 Distro: EndeavourOS
    base: Arch Linux
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: N/A
  Mobo: ASUSTeK model: ROG STRIX B650E-F GAMING WIFI v: Rev 1.xx
    serial: <filter> part-nu: SKU uuid: 16af70d7-ed6b-506d-7a95-c87f5403d39f
    UEFI: American Megatrends v: 3024 date: 08/02/2024
CPU:
  Info: 16-core model: AMD Ryzen 9 7950X bits: 64 type: MT MCP MCM
    smt: enabled arch: Zen 4 rev: 2 cache: L1: 1024 KiB L2: 16 MiB L3: 64 MiB
  Speed (MHz): avg: 1163 high: 5529 min/max: 545/5881 volts: 1.3 V
    ext-clock: 100 MHz cores: 1: 5519 2: 545 3: 545 4: 545 5: 545 6: 545 7: 5529
    8: 5508 9: 545 10: 5418 11: 545 12: 545 13: 545 14: 545 15: 545 16: 545
    17: 545 18: 545 19: 545 20: 545 21: 545 22: 545 23: 545 24: 545 25: 545
    26: 545 27: 545 28: 545 29: 545 30: 545 31: 545 32: 545 bogomips: 288114
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: NVIDIA AD102 [GeForce RTX 4090] driver: nvidia v: 560.35.03
    arch: Lovelace pcie: speed: 2.5 GT/s lanes: 16 ports: active: none
    off: DP-1,DP-3 empty: DP-2,HDMI-A-1 bus-ID: 01:00.0 chip-ID: 10de:2684
    class-ID: 0300
  Device-2: Logitech HD Pro Webcam C920 driver: snd-usb-audio,uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 5-2.2:3
    chip-ID: 046d:082d class-ID: 0102 serial: <filter>
  Display: unspecified server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2
    compositor: gnome-shell driver: X: loaded: nvidia unloaded: modesetting
    alternate: fbdev,nouveau,nv,vesa gpu: nvidia,nvidia-nvswitch
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 5120x1440 s-dpi: 96 s-size: 1355x381mm (53.35x15.00")
    s-diag: 1408mm (55.42")
  Monitor-1: DP-1 mapped: DP-0 note: disabled pos: left model: Asus MG279
    res: 2560x1440 dpi: 109 size: 597x336mm (23.5x13.23") diag: 685mm (27")
    modes: max: 2560x1440 min: 640x480
  Monitor-2: DP-3 mapped: DP-4 note: disabled pos: primary,right
    model: VG27A serial: <filter> res: 2560x1440 dpi: 109
    size: 597x336mm (23.5x13.23") diag: 685mm (27") modes: max: 2560x1440
    min: 640x480
  API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0 drv: nvidia device: 2
    drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia x11: drv: nvidia
    inactive: wayland,device-1
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 560.35.03
    glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce RTX 4090/PCIe/SSE2
Audio:
  Device-1: NVIDIA AD102 High Definition Audio driver: snd_hda_intel v: kernel
    pcie: speed: 16 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:22ba
    class-ID: 0403
  Device-2: ASUSTek USB Audio driver: hid-generic,snd-usb-audio,usbhid
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-6:2 chip-ID: 0b05:1a52
    class-ID: 0300
  Device-3: Logitech HD Pro Webcam C920 driver: snd-usb-audio,uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 5-2.2:3
    chip-ID: 046d:082d class-ID: 0102 serial: <filter>
  Device-4: JMTek LLC. USB PnP Audio Device
    driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 1.1 speed: 12 Mb/s
    lanes: 1 bus-ID: 5-2.4:4 chip-ID: 0c76:161e class-ID: 0300
  API: ALSA v: k6.10.6-arch1-1 status: kernel-api
  Server-1: PipeWire v: 1.2.3 status: n/a (root, process) with:
    1: pipewire-pulse status: active 2: wireplumber status: active
    3: pipewire-alsa type: plugin 4: pw-jack type: plugin
Network:
  Device-1: Intel Ethernet I225-V vendor: ASUSTeK driver: igc v: kernel pcie:
    speed: 5 GT/s lanes: 1 port: N/A bus-ID: 08:00.0 chip-ID: 8086:15f3
    class-ID: 0200
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: MEDIATEK MT7921K Wi-Fi 6E 80MHz driver: mt7921e v: kernel pcie:
    speed: 5 GT/s lanes: 1 bus-ID: 09:00.0 chip-ID: 14c3:0608 class-ID: 0280
  IF: wlan0 state: down mac: <filter>
Bluetooth:
  Device-1: MediaTek Wireless_Device driver: btusb v: 0.8 type: USB rev: 2.1
    speed: 480 Mb/s lanes: 1 bus-ID: 1-11:5 chip-ID: 0e8d:0608 class-ID: e001
    serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 2 state: up address: <filter> bt-v: 5.3
    lmp-v: 12 class-ID: 6c0104
Drives:
  Local Storage: total: 5.26 TiB used: 26.52 GiB (0.5%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 960 PRO 512GB
    size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 4B6QCXP7 temp: 35.9 C scheme: GPT
  ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO Plus 2TB
    size: 1.82 TiB speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 2B2QEXM7 temp: 47.9 C scheme: GPT
  ID-3: /dev/sda vendor: Western Digital model: WD30EZRZ-00GXCB0
    size: 2.73 TiB speed: 6.0 Gb/s tech: HDD rpm: 5400 serial: <filter>
    fw-rev: 0A80 scheme: GPT
  ID-4: /dev/sdb vendor: Samsung model: SSD 840 EVO 250GB size: 232.89 GiB
    speed: 6.0 Gb/s tech: SSD serial: <filter> fw-rev: DB6Q scheme: MBR
  ID-5: /dev/sdc vendor: SanDisk model: Ultra USB 3.0 size: 14.32 GiB
    type: USB rev: 3.0 spd: 5 Gb/s lanes: 1 tech: N/A serial: <filter>
    fw-rev: 1.00 scheme: MBR
Partition:
  ID-1: / size: 467.39 GiB used: 26.22 GiB (5.6%) fs: ext4 dev: /dev/nvme0n1p2
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 64.8 C mobo: 40.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 64 GiB note: est. available: 62.43 GiB used: 5.77 GiB (9.2%)
  Processes: 504 Power: uptime: 29m states: freeze,mem,disk suspend: deep
    wakeups: 1 hibernate: platform Init: systemd v: 256 default: graphical
  Packages: pm: pacman pkgs: 989 Compilers: gcc: 14.2.1 Shell: Sudo (sudo)
    v: 1.9.15p5 default: Bash v: 5.2.32 running-in: kgx inxi: 3.3.35```

https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Changing_suspend_method

While Nvidia did not show in dmesg it was related to GPU I think, after using
NVreg_PreserveVideoMemoryAllocations problems seems to be resolved. I no longer see pstate errors in the log.