[RESPONDED] AMD FW13 has started to reboot when resuming from hibernate (Ubuntu 22.04)

Hey all,

After experiencing a lot of battery drain with S0 sleep (God I miss S3 sleep), I enabled sleep-then-hibernate. It was working great until this week.

Now every time the laptop enters hibernate, it wakes to a fresh boot. No apps get restored or anything.

I’ve checked syslog and I don’t see anything that stands out. No ‘ERROR’ messages that I can see being related. I do see it entering hibernate.

Does anyone have any idea what is going on?

I can’t tell if it is not entering hibernate properly, or if it is entering hibernate, but not resuming properly.

What else should I look for here?

Jan 17 13:09:54 fw-rathbone systemd[1]: Starting Record successful boot for GRUB...
Jan 17 13:09:54 fw-rathbone systemd[1]: Starting Hibernate...
Jan 17 13:09:54 fw-rathbone kernel: [ 3088.864919] PM: Image not found (code -22)
Jan 17 13:09:54 fw-rathbone systemd[1]: grub-common.service: Deactivated successfully.
Jan 17 13:09:54 fw-rathbone systemd[1]: Finished Record successful boot for GRUB.
Jan 17 13:09:54 fw-rathbone systemd[1]: Starting GRUB failed boot detection...
Jan 17 13:09:54 fw-rathbone systemd[1]: grub-initrd-fallback.service: Deactivated successfully.
Jan 17 13:09:54 fw-rathbone systemd[1]: Finished GRUB failed boot detection.
Jan 17 13:09:54 fw-rathbone kernel: [ 3088.900403] audit: type=1107 audit(1705518594.097:419): pid=982 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.17" mask="receive" pid=4843 label="firefox" peer_pid=1014 peer_label="unconfined"
Jan 17 13:09:54 fw-rathbone kernel: [ 3088.900403]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Jan 17 13:09:54 fw-rathbone systemd-sleep[9557]: Entering sleep state 'hibernate'...
Jan 17 13:09:54 fw-rathbone kernel: [ 3088.908288] audit: type=1107 audit(1705518594.105:420): pid=982 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal"  bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.17" mask="receive" pid=4843 label="firefox" peer_pid=1014 peer_label="unconfined"
Jan 17 13:09:54 fw-rathbone kernel: [ 3088.908288]  exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Jan 17 13:09:54 fw-rathbone kernel: [ 3088.909062] PM: hibernation: hibernation entry
Jan 17 13:10:49 fw-rathbone systemd-modules-load[565]: Inserted module 'lp'
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000] Linux version 6.1.0-1028-oem (buildd@lcy02-amd64-120) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Dec 13 15:38:49 UTC 2023

I can see it wake up after:

Jan 17 13:10:49 fw-rathbone systemd-modules-load[565]: Inserted module 'lp'
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000] Linux version 6.1.0-1028-oem (buildd@lcy02-amd64-120) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Dec 13 15:38:49 UTC 2023
Jan 17 13:10:49 fw-rathbone systemd-modules-load[565]: Inserted module 'ppdev'
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-1028-oem root=UUID=8515e92d-1574-44db-8473-d4d2c2aaf358 ro quiet splash vt.handoff=7
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000] KERNEL supported cpus:
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000]   Intel GenuineIntel
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000]   AMD AuthenticAMD
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000]   Hygon HygonGenuine
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000]   Centaur CentaurHauls
Jan 17 13:10:49 fw-rathbone systemd-modules-load[565]: Inserted module 'parport_pc'
Jan 17 13:10:49 fw-rathbone kernel: [    0.000000]   zhaoxin   Shanghai  
...

This is not something I have had cycles to explore, instead referring folks to using suspend with AMD configs.

I have not touched hibernate since 22.10 (non_LTS test), on Intel config - not anything with the 7040 series.

Ideally we want folks using suspend and


Likely flow based on my last time doing this

(Zero warranty as to this working provided or not translating into new issues, this is as is. As for the sed command, this assumes a non-Fish terminal)

sudo swapoff -v /swapfile

sudo rm -f /swapfile

create new swapfile

sudo dd if=/dev/zero of=/swapfile count=37000 bs=1MiB

I’ll use 37000.

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

sudo gedit /etc/fstab

If you have a /swap file reference showing up correctly, close the editor and move onto the next step. If not, make sure swap matches:

/swapfile none swap sw 0 0

Then find the UUID via command:

blkid

Mine was UUID=“b432a6a4-6663-45e6-9b4f-93eaf69ba9a0”

To find the physical offset for /swapfile, run command:

sudo filefrag -v /swapfile

Scroll back up, look for (image)

Mine was 7802880
sudo sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT/ s/"$/ resume=UUID=b432a6a4-6663-45e6-9b4f-93eaf69ba9a0 resume_offset=7802880"/' /etc/default/grub

sudo update-grub

Hey! I followed that procedure almost exactly when I set up hibernate.

Looks like some software update blitzed my /etc/default/grub changes. That makes sense now.

If so, is there a better place to put those defaults?

Maybe the resume data can go in /etc/defaults/grub.d/hibernate.cfg or something like that, would that work?

To my knowledge nothing should wipe out your edits to /etc/default/grub (assuming you ran sudo update-grub). But I wonder if maybe you missed that last step. Perhaps your laptop was simply hibernating while this fix was “working”, and then fix stopped working on the next boot ? I don’t actually know if the changes would ever be applied without update-grub though (i.e., how would the fix have worked in the first place without running that final command to rebuild the grub cfg)…

Looks like sed may not be working for you.

So in instead may be:

GRUB_CMDLINE_LINUX_DEFAULT=“quiet splash resume=UUID=XXXXXXXXXXXXXXXXXXXXXX resume_offset=XXXXXXXX”

We do want to keep to using grub (worth backing it up when changing), but using grub for the resume as shown above.

Thanks so much for all your help!

So my grub defaults file was updated yesterday…the same day I updated the OEM kernel.

Is there a chance that updating the OEM kernel would blitz /etc/default/grub?

Seems unlikely, but I definitely applied the changes, it was a few weeks ago I set up hibernate and it was working fine until this week.

Hey.

I don’t own a Framwork system but I have a hunch that this is a platform issue related to AMD since I’m faceing the same issue.

I’m having a Lenovo Z13 openSUSE Linux Kernel 6.9.1.

I faced exact the same issue. I hibernate, the device takes some time to shutdown after the linux done the device blinks a few times and then is off.
I press the power buton the efi logo appears Linux loads… but no session is restored.
The logs reveal the image isn’t found.

When changing HibernateMode in systemd to shutdown the system finds the hibernate image correctly and restores what was previously saved.
The kernel defaults to platform which is ACPI S4 I believe on x86 AMD.

To apply the workaround save the contents below in /etc/systemd/sleep.d/10-hibernatemode.conf:

[Slee]
HibernateMode=disk