[RESPONDED] Laptop sometimes won't wake from sleep (Kubuntu 22.04.4 LTS)

I am using Kubuntu 22.04.4 LTS with the 6.5.0-1020-oem Kernel, Plasma 5.24.7 and X11. Secure Boot is enabled for some reason.
Sometimes, when putting the laptop to sleep, it will not properly wake again. The integrated display as well as any connected external displays stay off, the power button, however, is permanently lit as if the laptop was turned on.
The only way I have found to recover from this state is to reboot. Sometimes, simply pressing the power button will reboot (with a shutdown animation on screen), sometimes a hard reboot has to be performed.
I have not been able to find a way to reliably reproduce this issue. However, it only happens when the laptop stays in sleep for a somewhat extended period of time (i.e., > 10 min).
I have followed the installation instructions for Ubuntu 22.04 and not changed any low-level settings. This issue has also happened on a completely fresh install of Kubuntu. For troubleshooting, I have reset the BIOS.

The only other indication of any issues that I have is an error message when booting:
cros_ec_lpcs cros_ec_lpcs.0: EC ID not detected.

Any help would be greatly appreciated as this is very annoying :slight_smile:

Moved your thread to Linux subcategory for better visibility.

Im having a similar problem on my Framework 16. Im using Fedora 40 stable (did it on the beta as well and I did a clean install between both)
Most of the time when the laptop goes to sleep, it works fine, but every now and then when it goes to sleep and I try and wake it up, nothing happens and the power button pulses on and off. Only way to get it to turn on again is to hold the button till the system reboots.

These reports are similar to point #4 in this message of mine:

That being said, I have not encountered that issue since two weeks ago.

Yup, that post and the one below that was also from you are pretty much exactly whats happening to me as well. Doing a bios update seemed to help it. It went from happening every single time, to every now and then, and the logs from journalctl didn’t help at all either.

Unfortunately, I have already upgraded my BIOS to the latest version. Journalctl also lists errors (most pertaining to amdgpu, the journal now seems to be overwritten though).

EDIT: I have since been able to reproduce the errors in journalctl. Note that this happened when trying to enter sleep, not when trying to wake - the amdgpu errors, however, are the same as when failing to correctly wake from sleep.

For AMD users (FW16 for example)

Please run this script.

  • Download, run with:

sudo python3 amd_s2idle.py

Paste output back here. I have not had any issues waking up FW16 from suspend. Please run the script after the next occurrence, paste results here in a reply.

Also include all devices attached (displays with how they are attached in detail, docks, other peripherals)

Additionally, we do not test against KDE, so it’s not impossible there is correlation there - not something I’ve seen with KDE on Fedora, but we have seen it with other distros using KDE.

I told it to run 10 times as it doesn’t happen every single time, but it happened on the first run. Laptop is plugged into the 180w charger. Nothing else is connected.
Running Fedora 40 KDE (stable)

Thanks for your reply! This is from a run I just did in which the laptop failed to suspend. It failed to wake from sleep a few minutes earlier.
I don’t know why my kernel is flagged as tainted. The solution suggested by the script does not work, as ryzen_smu is not installed or loaded. I have tried re-installing the Framework kernel, this also did not resolve the ‘tainted’ warning.
For running this script, I have removed all expansion cards and am using only the integrated display, keyboard (and numpad) and touchpad.
The interesting thing I have noticed while running this script repeatedly is that the laptop only seems to fail suspending when applications (with a gui) run in the background. The only applications I have identified so far that can run without causing problems are Konsole, VLC and Google Chrome.

Since my last reply, I have upgraded to Kubuntu 24.04 and the 6.8.0-31-generic kernel. As far as I can tell after one day of use, this has solved my issues and does not produce any amdgpu errors in the journal.

Im still having the issue unfortunatly. Im on kernal version 6.8.7-300 stock fedora

@Conan_Kudo is this something you’ve experienced with Fedora 40 KDE by chance? This customer’s s2idle report is above.

1 Like

I didn’t observe this issue back when I had my laptop configured to sleep (right now it doesn’t do that as it sits docked all the time these days). I’m away from my Framework 16, so I can’t switch it back to do sleep and see what happens.

1 Like

Just wanted to give an update, an update on my system seems to have fixed it. No clue what changed, but it works now.

Heres the s2idle of my machine now that it is working properly just incase it helps you fix it for anyone else

Your test doesn’t look to me.

amd_pmc AMDI0009:00: Last suspend didn’t reach deepest state

Specifically it looks like a problem with one of your USB4 routers (domain1). This one doesn’t have the thunderbolt driver bound to it.

BTW - I expect the newer versions of the script should flag this issue.

0000:c6:00.5 : Advanced Micro Devices, Inc. [AMD] USB controller [1022:1668] : _SB_.PCI0.GP19.NHI0

If you can keep reproducing it and haven’t done anything to cause this, you should raise a bug report with Fedora. You’ll want to add thunderbolt.dyndbg=+p to kernel command line.

Yup you are absolutely right. While it wakes from sleep no problem, it still drains quickly while in sleep, but at least it doesn’t heat up to an insane level while in sleep. Now its just slightly above room temp while in sleep and idle for a while.

I don’t think I’ve caused anything to cause that bug to form. I haven’t messed around with the kernal at all. I’ll see if I can reproduce it over a period of time. I’d prefer to not reinstall but if I need to, I can.

I’ve experienced similar issue after upgrading to BIOS 3.08 but on Intel gen12.

I am seeing these messages:

[    2.097252] cros_ec_lpcs cros_ec_lpcs.0: Chrome EC device registered
[   11.245961] cros-usbpd-charger cros-usbpd-charger.2.auto: Unexpected number of charge port count
[  985.841143] cros_ec_lpcs cros_ec_lpcs.0: packet too long (22094 bytes, expected 24)
[  985.842469] cros_ec_lpcs cros_ec_lpcs.0: packet too long (7 bytes, expected 0)
[ 1309.469080] cros_ec_lpcs cros_ec_lpcs.0: bad packet checksum 00

This just happened to my laptop, sometime last night. Here are some details in case it helps the debugging:

  • Framework 16, Ubuntu 23.10, latest BIOS from April
  • When I arrived downstairs, the fan was running full blast and it looked like it was sleeping, but it wouldn’t wake.
  • Held the power button down for a few seconds.
    • Usually this will cause it to power down and I get to start a fresh reboot and try to restore whatever state I had.
    • This happens every month or so.
    • It also happened on my Intel 13", so I’ve resigned myself to doing this every so often. I guess sleep/wake is really hard for x86 to get right. Maybe Intel and/or AMD should try poaching some firmware people from Apple?
  • Instead of rebooting, it went into a doom loop of showing funny animations on the LED screen next to the keyboard, and slow-blinking the power button.
  • Repeated several times:
    • Held the power button down.
    • After about 10 seconds, the laptop would shutdown and instantly reboot.
    • There didn’t seem to be any way to turn it off.
    • Each reboot immediately re-entered the slow-blink doom loop.

At this point, I found this thread, and started the process of opening up the laptop to remove the battery, even though there was no way to turn it off first. I also started looking up the RMA process since the laptop seemed to be dead. However, I barely got the keyboard unlocked before it fresh-booted and recovered!

Syslogs reveal that Linux thought it was actually running – not sleeping – until about the time I did the first long-press reboot.

And here’s the output of the python script. I can’t see anything interesting in it, but maybe you can!

11:28 > sudo python3 ./amd_s2idle.py 
[sudo] password for robey: 
Location of log file (default s2idle_report-2024-07-07.txt)? 
👀 Udev access library `pyudev` is missing. Attempting to install.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  python3-wxgtk4.0 python3-pyqt5
The following NEW packages will be installed:
  python3-pyudev
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 33.0 kB of archives.
After this operation, 199 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu mantic/main amd64 python3-pyudev all 0.24.0-1 [33.0 kB]
Fetched 33.0 kB in 0s (97.6 kB/s)         
Selecting previously unselected package python3-pyudev.
(Reading database ... 266025 files and directories currently installed.)
Preparing to unpack .../python3-pyudev_0.24.0-1_all.deb ...
Unpacking python3-pyudev (0.24.0-1) ...
Setting up python3-pyudev (0.24.0-1) ...
👀 ACPI extraction tool `iasl` is missing. Attempting to install.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  acpica-tools
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 887 kB of archives.
After this operation, 2,553 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu mantic/universe amd64 acpica-tools amd64 20200925-8 [887 kB]
Fetched 887 kB in 1s (1,417 kB/s)    
Selecting previously unselected package acpica-tools.
(Reading database ... 266059 files and directories currently installed.)
Preparing to unpack .../acpica-tools_20200925-8_amd64.deb ...
Unpacking acpica-tools (20200925-8) ...
Setting up acpica-tools (20200925-8) ...
Processing triggers for man-db (2.11.2-3) ...
Debugging script for s2idle on AMD systems
💻 Framework Laptop 16 (AMD Ryzen 7040 Series) (16in Laptop) running BIOS 3.3 (03.03) released 03/27/2024 and EC unknown
🐧 Ubuntu 23.10
🐧 Kernel 6.5.0-42-generic
🔋 Battery BAT1 (NVT FRANDBA) is operating at 104.66% of design
Checking prerequisites for s2idle
✅ Logs are provided via systemd
✅ AMD Ryzen 9 7940HS w/ Radeon 780M Graphics (family 19 model 74)
✅ SMT enabled
✅ LPS0 _DSM enabled
✅ ACPI FADT supports Low-power S0 idle
✅ HSMP driver `amd_hsmp` not detected (blocked: False)
✅ PMC driver `amd_pmc` loaded (Program 0 Firmware 76.82.0)
✅ USB4 driver `thunderbolt` bound to 0000:c6:00.5
✅ USB4 driver `thunderbolt` bound to 0000:c6:00.6
✅ GPU driver `amdgpu` bound to 0000:03:00.0
✅ GPU driver `amdgpu` bound to 0000:c4:00.0
✅ System is configured for s2idle
✅ NVME Sandisk Corp is configured for s2idle in BIOS
✅ GPIO driver `pinctrl_amd` available
🚦 Device firmware checks unavailable without fwupd gobject introspection
How long should suspend cycles last in seconds (default 10)? 
How long to wait in between suspend cycles in seconds (default 4)? 
How many suspend cycles to run (default 1)? 
Started at 2024-07-07 11:29:50.258893 (cycle finish expected @ 2024-07-07 11:30:04.258918)
Results from last s2idle cycle
○ Suspend count: 1
○ Hardware sleep cycle count: 1
○ GPIOs active: ['84']
○ Wakeup triggered from IRQ 9: ACPI SCI
○ Woke up from IRQ 9: ACPI SCI
○ gpe0B increased from 111 to 115
✅ Userspace suspended for 0:00:14.883927
✅ In a hardware sleep state for 0:00:05.809600 (39.03%)
🔋 Battery BAT1 (NVT FRANDBA) is operating at 104.66% of design

There is a known issue with the linux kernel on AMD systems with NVMe SSD’s.
updating to v6.10-rc4 may resolve your issue. This does however require secure boot to be disabled:
https://kernel.ubuntu.com/mainline/v6.10-rc4/

Probably it’s this.

2 Likes