[GUIDE] Framework Laptop 16 Suspend Waking Up Early Or Failing To Suspend Fix

For what it’s worth, it looks like a patch to automatically flip this flag made it into the kernel recently ish. If I understand correct, you can check if your kernel is already doing this with

cat /sys/module/rtc_cmos/parameters/use_acpi_alarm 
Y

The Y means this flag is set.

2 Likes

Could there be a similar kernel issue where the lock screen freezes, and you have to force shut down the device by holding down the power button? (Admin, if this needs to be on another thread, please move it.)

I did the GRUB workaround that Matt Hartley suggested for the original issue and it seems to have fixed my issue also. Thanks, Matt.

1 Like

Music to my ears! Thanks for the update. :slight_smile:

I’m having the same problem with waking up from suspend after a few seconds. I tried the workaround above, but it didn’t make a difference for me. I have the same issue on ubuntu 24.04, 22.04, fedora 40, and linux mint. I tried running the script if that helps.

1 Like

Thank you, that worked for me. I am on EndeavourOS with systemd-boot so I had to edit /etc/kernel/cmdline and add the rtc_cmos.use_acpi_alarm=1 there.
Then remember to run sudo reinstall-kernels to apply the change to all entries.

Same here. Fresh install of 24.04 latest bios update and it immediately crashes upon waking from suspend.

1 Like

I’m on Ubuntu 24.04 (Linux 6.8.0) and my laptop wakes up randomly, sometimes in my backpack. This could be dangerous.

Before I try random solutions, is there a way to configure the laptop so that it only wakes up by pressing the power button? That would solve all problems, as it can never be unintentional. I don’t want it to wake up by USB events, lid events, keyboard events, or anything else.

1 Like

I am on NixOS Unstable and I am also having this problem, it existed on 24.05 and after changing to Unstable. But it was fine in a 23.11 live ISO. I have tried 2 workarounds in my kernel params with no change in result. Currently I have to press hibernate, wait for it to save to disk, then hold down the power button until it actually shuts down. It will then restore like normal next boot. If it is important I am on an encrypted file system with my swap being a logical volume under the encrypted LVM on LUKS partition.

A new mainboard fixed it for me. I had a couple other issues too though. I would ask support if you haven’t. They’re very helpful.

@tobiac
There are various ways to make the FW16 AMD laptop only wake up on the power button, using udev or scripts.
The following disables: Keyboard, Touchpad and lid opening from waking up the laptop.
I use a script on Ubuntu:

#!/bin/sh
# This file should be placed in directory: /usr/lib/systemd/system-sleep

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
	pre)	echo disabled > /sys/devices/pci0000:00/0000:00:08.1/0000:c1:00.3/usb1/1-4/1-4.3/power/wakeup
		echo disabled > /sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00/power/wakeup
		echo disabled >/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:4b/PNP0C09:00/PNP0C0D:00/power/wakeup
		exit 0
		;;
	post)	exit 0
		;;
 	*)	exit 1
		;;
esac
2 Likes

Cool, thank you!
Is there a way to disable all wakeup events by default, except for the power button, instead of listing specific devices?

Not that I am aware of, or I would have tried that.
To get a list of everything that could possibly wake up the laptop you can do:
find /sys -iname "wakeup" | grep "\/power\/wakeup"

As you can see, there are lots of different things that can wakeup.
If you have a number-pad in addition to the keyboard, you will probably need to add an extra line in for that.

I could find all devices with a wakeup option, excluding the power button, and disable them:

find /sys/devices/ -path \*/power/wakeup ! -path /sys/devices/.../power/wakeup -exec 

How can I tell what is the power button device?

This one is the power button, so you probably don’t want to disable this one:
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/power/wakeup

You can check what PNP0C0C is with this:

cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input1/name
Power Button

So, in general look for a “name” file in the file tree close the the “/power/wakeup” file and you should be able to find a name for it.

1 Like

Thank you for your help, James!
I ended up with the following script, that disables every wakeup device except for the power button, which is perfect for my use case.

#!/bin/sh
# This file should be placed in directory: /usr/lib/systemd/system-sleep

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
  pre)
    # Disable all wakeup devices except for the power button
    find /sys/devices -path '*/power/wakeup' ! -path '*/LNXSYSTM:00/*' |
      while read wakeup; do echo disabled > $wakeup; done
    exit 0
    ;;
  post)
    exit 0
    ;;
  *)
    exit 1
    ;;
esac
1 Like

Sleep and wake use cases are complex.
One use case you might want to consider is the battery wake up. This should wakeup the laptop when the battery is low. Purpose then is to hibernate, (suspend-to-disk) so you don’t loose work.
At least on Linux the choice of what wakes is user selectable so each user can choose.

1 Like

Nice. Yes, for this use case this is a solid workaround.

Updated script (the match condition was wrong)

#!/bin/sh
# This file should be placed in directory: /usr/lib/systemd/system-sleep

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
  pre)
    # Disable all wakeup devices except for the power button
    find /sys/devices -path '*/power/wakeup' \
                    ! -path '*/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/*' |
      while read wakeup; do echo disabled > $wakeup; done
    exit 0
    ;;
  post)
    exit 0
    ;;
  *)
    exit 1
    ;;
esac
2 Likes

Wrote a script based on @James3 and @tobiac 's conversation to find the paths which you want to disable, since I am nervous about disabling everything.

#!/bin/sh

to_disable_names=("Touchpad" "Mouse" "Keyboard")

wakeups=$(find /sys/devices -path '*/power/wakeup')
to_disable_devices=()
for wakeup in $wakeups; do
    device=$(echo "$wakeup" | xargs dirname | xargs dirname)
    names=$(echo "$device" | xargs -I{} find {} -path '*/name' | xargs cat)

    # # Uncomment to print all devices and names:
    # echo "$wakeup vvvvvvvvvvvvvvvvvvvvvvvvvvvv"
    # echo "$names"
    # echo ""
    # # ---end

    # Uncomment to find wakeup paths:
    for to_disable_name in "${to_disable_names[@]}"; do
        if echo "$names" | grep -q "$to_disable_name"; then
            printf '%-80s # %s\n' "$wakeup" "$to_disable_name"
        fi
    done
    # ---end
done

Output:

/sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00/power/wakeup             # Touchpad
/sys/devices/platform/AMDI0010:03/i2c-1/i2c-PIXA3854:00/power/wakeup             # Mouse
/sys/devices/pci0000:00/0000:00:08.1/0000:c4:00.3/usb1/power/wakeup              # Keyboard
/sys/devices/pci0000:00/0000:00:08.1/0000:c4:00.3/usb1/1-3/1-3.2/power/wakeup    # Keyboard
/sys/devices/pci0000:00/0000:00:08.1/0000:c4:00.3/usb1/1-3/power/wakeup          # Keyboard
/sys/devices/pci0000:00/0000:00:08.1/0000:c4:00.3/usb1/1-4/power/wakeup          # Keyboard
/sys/devices/pci0000:00/0000:00:08.1/0000:c4:00.3/usb1/1-4/1-4.2/power/wakeup    # Keyboard
/sys/devices/pci0000:00/0000:00:08.1/0000:c4:00.3/power/wakeup                   # Keyboard
/sys/devices/pci0000:00/0000:00:08.1/power/wakeup                                # Keyboard