Troubleshooting Hibernate - AMD Ryzen 7040

I’ve noticed that if I try to upgrade past kernel version 6.10.14, hibernate stops working for me. I’m not sure where to start troubleshooting this. Has anyone been able to get hibernate working on a kernel version newer than this?

edit: The symptom I’m experiencing on newer kernels is on resume. When I try to resume from hibernate on a newer kernel the system freezes on startup.

Which Linux distro are you using?
Fedora

Which release version?
41

Which kernel are you using?
6.10.14-200.fc40.x86_64. Anything higher than this, hibernate stops working.

Which BIOS version are you using?

paul@fedora:~$ sudo dmidecode | grep -A3 'Vendor:\|Product:' && sudo lshw -C cpu | grep -A3 'product:\|vendor:'
	Vendor: INSYDE Corp.
	Version: 03.05
	Release Date: 03/29/2024
	Address: 0xE0000
       product: AMD Ryzen 5 7640U w/ Radeon 760M Graphics
       vendor: Advanced Micro Devices [AMD]
       physical id: 4
       bus info: cpu@0
       version: 25.116.1

selinux

paul@fedora:~$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33

Partitioning

Parition Mount Point File System Type Size
/dev/nvme0n1p1 /boot/efi fat32 630 MB
/dev/nvme0n1p2 /boot ext4 1 GB
/dev/nvme0n1p3 swap swap 38 GB
/dev/nvme0n1p4 / btrfs 107 GB
/dev/nvme0n1p5 /home btrfs ~remaining

I discovered through some trial and error that I can get hibernate working with the 6.10 series of kernels by having a swap partition. I can also leave selinux enabled this way.

I was able to install this older kernel on Fedora 41 by using koji. Guide: Installing Kernel from Koji :: Fedora Docs

Anyway, can someone help me to troubleshoot this? The 6.10.14 kernel is working for me now, but it would be nice to be able to upgrade at some point.

Yes there is a known issue with amd and suspend related to bluetooth. You can crreate a systemd unit hook that disables bluetooth/wifi and re-enables it on resume

1 Like

Ok. I forgot to mention that I have a script that does that.

File: /usr/lib/systemd/system-sleep/hibernate-pre-post.sh

#!/bin/bash
WiFiModule=mt7921e

case "$1 $2" in
  "pre hibernate" | "pre suspend-then-hibernate")
    modprobe -r $WiFiModule
    ;;
  "post hibernate" | "post suspend-then-hibernate")
    modprobe $WiFiModule
    ;;
  *)
    :
    ;;
esac

I still can’t get hibernate to work on anything past kernel version 6.10.14. Does anyone have some other troubleshooting steps I can try?

I got the same problem on Arch, you need to disable bluetooth before hibernating, wifi doesn’t seem to affect

1 Like

In recent kernels the bt/wifi problems seem to have been fixed, and for me at least hibernate and restore works fine for 6.11.5 onwards. Now on 6.12.1-arch1-1.
I do have iGPU glitches since 6.11.x though (Framework 16).

1 Like

For some reason not fixed on BT but fixed on wifi, tested today on 6.12.1-arch1-1

1 Like

Awesome!

I’m on 6.11.8 now! Here’s the modified script to get my system to successfully hibernate and resume:

File: /usr/lib/systemd/system-sleep/hibernate-pre-post.sh

#!/bin/bash
BtUsbModule=btusb

case "$1 $2" in
  "pre hibernate" | "pre suspend-then-hibernate")
    systemctl stop bluetooth
    modprobe -r $BtUsbModule
    ;;
  "post hibernate" | "post suspend-then-hibernate")
    modprobe $BtUsbModule
    systemctl start bluetooth
    ;;
  *)
    :
    ;;
esac

Apparently the only module I had to unload was btusb. Thanks everyone for your help.