Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Admin message
The migration is almost done, at least the rest should happen in the background. There are still a few technical difference between the old cluster and the new ones, and they are summarized in this issue. Please pay attention to the TL:DR at the end of the comment.
Ryzen 4700U failing to enter suspend/modern-standby correctly
When I close the lid of my laptop, it does not actually enter the suspend/sleep state. The fan is still mildly audible, and dmesg shows some stack traces related to failing to enter suspend.
If I wait a longer period of time (30-45 minutes?), the fan is no longer spinning, but I can see by peeking between the LCD/body that the power-LED is still on (as if the laptop is still on with the fan/screen off). If I open the lid, the laptop does not come back from its pseudo-sleep, and there are no keys that can be pressed that will "wake it" up.
AMD package version: None. Currently running libdrm master as of commit 669e1087ab606 and mesa master as of commit 395511d16915297b39d11.
How to reproduce the issue:
Detach power cord, close lid. Wait a few seconds and observe that the CPU cooling fan is still spinning audibly. Let it sit for a while (~1 minute) and re-open the lid. Run dmesg and inspect log for evidence of the suspend sequence.
Attached files:
Dmesg log taken after closing the lid, waiting 10-15 seconds, and then re-opening it.
dmesg
Edited
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
A little research seems to indicate that it's possible that this is related to an issue that was also present in some Lenovo IdeaPad models and which prompted a firmware update for that laptop.
Dell (and i suppose some others) dont support S3 at all and have entirely removed deep sleep. mem_sleep doesnt even have deep option listed for me. So using S3 sleep while desirable and simple solution is not possible on many new hardware.
I had a chance to touch 2 almost same Dell machines - Inspiron 5401 (Intel) and Inspiron 5405 (AMD). They are twins - you can even switch motherboards between them. And the comparison shows:
Only AMD version has S3 completely disabled. On Intel version you can activate S3 in BIOS.
On Intel version s3idle works perfectly in Linux.
Everything works in Windows for AMD and Intel - so both cpu's have no hardware issues.
So the issue is not with s2idle in Linux, this is exclusively for AMD platform. AMD linux drivers are not yet ready to support laptops.
Yeah dell laptops have option to enable s3 sleep on intel models AND intel supports s0ix sleep on linux so intel shouldnt have any issue. I have the 7405 which is similar to 5405 and it doesnt have s3 either. I tried editing acpi table to get it working but earlier it would just crash, with updated firmware i just dont get s3. Even with edited table it just doesnt list s3 for some reason so unless amd implements s0ix we all are SOL.
This was a problem even on windows when i got my laptop. It would just not resume from sleep. AMD has since updated their drivers to fix it on windows though afaik, but for a while sleep just didnt exist on ryzen mobile platform which i find quite shocking.
No options in the bios to toggle any sleep modes. The only customizations that I've made in the bios settings is to make sure virtualization is enabled, disable secure boot, and flip the boot order around to prioritize grub over the native windows bootloader (I've preserved the windows 10 partition the machine came with alongside the ubuntu 20.04 install I added).
I've also checked around and there's no Windows vs Other OS toggles that I can see either.
Hey @awatry, I'm on an Envy x360 13, sporting a 3500U, similar issues, but it turns out these laptops do have deep S3 sleep support; but HP's ACPI tables don't announce it to the OS.
I ended up decompiling parts of the tables, editing, overwriting and recompiling.
run acpidump -o tables to create a file with the currently running tables
acpixtract -a tables to extract the individual tables (we only care about the FACP table)
iasl -d facp.dat to disassemble the FACP table
edit facp.dsl with your prefered text editor.
set the "Oem Revision" field at the top to a larger number
set the "Hardware Reduced (V5)" field to 0
iasl -sa facp.dsl to assemble your modified table
Make the following folder structure: payload/kernel/firmware/acpi/
IN the acpi folder add your compiled facp.aml
In the payload folder, run: find kernel | cpio -H newc --create > acpi_override.cpio.img
Move the resulting acpi_override.cpio.img to your /boot folder, then update grub so your initrd line looks something like this:
initrd /boot/amd-ucode.img /boot/initramfs-linux.img /boot/acpi_override.cpio.img
Also change your Grub CMDLINE to force deep sleep as default for good measureGRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem_sleep_default=deep"
Hopefully you should then see deep sleep when you run cat /sys/power/mem_sleep.
Thanks @jmaris, I'll give that a shot. I had already found a related guide on getting S3 sleep working on an X1 carbon by editing the ACPI tables in a similar manner, but hadn't spent the time trying to figure out which edits to make for my laptop. I'll give your steps a shot on my machine and see how it works out.
Also, thanks @agd5f for the response. I'll try hacking the ACPI tables a bit to get this to work, but it's definitely not an optimal/permanent solution, and upstream support would be appreciated.
@jmaris, that doesn't seem to be the case on the 15-ee series, 15 inch with 4700U. That value is already 0, additionally they have a conditional around the S3 support in DSDT. I've patched out the conditional, and it appears to do something, but I'm not sure if it is entering S3 and just unable to exit due to potentially missing support elsewhere in the tables or failing altogether. I can supply the tables if that helps. Now that I'm thinking about it, I should probably grab the journal after the S3 resume failure..
Name (_S0, Package (0x04) // _S0_: S0 System State { Zero, Zero, Zero, Zero }) If ((CNSB == Zero)) { If ((DAS3 == One)) { Name (_S3, Package (0x04) // _S3_: S3 System State { 0x03, 0x03, Zero, Zero }) } } Name (_S4, Package (0x04) // _S4_: S4 System State { 0x04, 0x04, Zero, Zero })
Edit: S3 journalctl shows entering S3 and then nothing, so my guess is tables are missing support for keyboard/power button/etc to exit sleep.
I have the 15z-ee000 and made the same modification to the ACPI tables by removing the conditional preventing S3. Unfortunately, I am also having the same issue with nothing bringing the laptop out of sleep but I did find a wakeup file under /sys/devices/platform/i8042/serio0/power/wakeup that defaults to disabled. Setting that to enabled doesn't seem to change anything in respect to waking from sleep though.
Sorry I don't have a solution but hoping this is pointing us in the right direction.
I have the HP Pavilion 15z-eh000 and I have followed @jmaris' patch and unfortunately S3 is not enabled. Best I can get is s2idle and it freezing. I contacted HP on the matter and it seems like they really don't care enough to release a UEFI update that would give us the option to revert back to the traditional standby method that has worked in laptops for years.
@sovanyio Do you happen to have a USB->Ethernet adapter to attempt Wake-on-LAN? It's a long-shot, but it might give another data point.
And yeah, I had disassembled the ACPI tables after my previous post and came to the same conclusion about the Hardware Reduced flag.
This laptop boots so fast that it's annoying, but not show-stopping, that I have to shut it down every time I am done using it. That will change eventually, but for now I'll give it another kernel release and see if things improve.
Finally got around to testing usb-eth wol and it did not work.
My partner uses this laptop, so maybe the shutdown is a cleaner way to go. Currently I have it set to hibernate on lid close, but maybe no boot menu with a linux-shortcut to the windows partition would be a less annoying workaround.
Just as an FYI to others with a similar issue. I was getting sick of the laptop hanging when unplugging and moving my laptop if I forgot to tap a key first, so I finally went and disabled suspend on the system and enabled hibernate as my default on-lid-close action (after adding a swap partition and configuring the system appropriately for hibernate, with changes in /etc/systemd/sleep.conf and /etc/systemd/logind.conf among other locations).
At least now, if the laptop is idle, it'll hibernate instead of try to suspend (and then hang).
Any idea where to look for clues if hibernate has the same effect as suspend? s1, s3, and s4 all have indistinguishable behavior to me: #1230 (comment 902971)
@awatry, As far as my debugging has gone, it doesn't appear that my Zenbook UM425IA actually hangs when it wakes from s2idle suspend, but rather the amdgpu driver crashes irrecoverbly.
Currently, with the latest kernel 5.8.9, and GRUB startup flags amdgpu.gpu_recovery=1, it sees a generally higher chance of recovering properly from s2idle suspend. I've configured my current Zenbook to suspend-then-hibernate if it suspends at s2idle for longer than 15 minutes, and have generally seen pretty good success rates with waking up from both s2idle suspend and s4 hibernate states. Perhaps your HP Envy x360 might also benefit from the startup flag?
I have a very similar problem: just purchased hp envy x360 13 ryzen 4700U 16G RAM, installed fedora 32 updated kernel to 5.8.11. Hibernate immediately puts the computer to sleep but in reality shuts it down. After pressing power button to wake up it actually goes through a regular start-up. Suspend just dims the screen, fan keeps on working. Plus usb c - HDMI does not work - under Fedora I cannot connect a second monitor (which is possible in Windows). It is a very compact computer - there is not dedicated HDMI port. I am anxiously waiting for some feedback on how to proceed further. I am a data scientist/statistician limited background in computer science. Hence sorry for any imprecisions.
@lflare I'll give that a shot. Hibernate has been working fairly reliably for me, but I wouldn't mind being able to speed up the resume time from the current state (basically a cold-boot that restores what you were working on)
@milena.stat If you've got the grub boot flags for resuming from hibernate as well as a swap partition setup for it to write memory to, you should at least be able to hibernate + resume whatever you were working on... but yeah, it'll be a full power-off from your perspective, and it takes a little while to boot back up. The up-shot is that if you don't leave it plugged in, it can hibernate pretty much indefinitely without draining its own battery.
I have had success with USB-C -> HDMI output using an external dock/hub, so I wouldn't give up on that one just yet. I've successfully hooked my laptop up to my TV using that USB-C dock's HDMI output and both video and audio output were working correctly. Can't say much more to help there, other than that it can work.
hi Aaron, thanks for this quick reply. The good news is that after several reboots usb c - hdmi started working and outputs video to an external monitor! (at the same I realized that in my 9-in-1 hub 3 out of 3 usb 3.0 ports do not work under Fedora and I had to connect my bluetooth keyboard and mouse via an old USB 2.0 hub, as long as it works I am fine with it).
For hibernate if I could make it work properly I could comfortably wait for a solution to the "suspend" problem while continuing to work on the machine. However right now if type in terminal sudo systemctl hibernate effectively my OS performs sudo shutdown -r now.
When I want to resume the system goes through a normal startup, asks to choose an OS (dual boot Windows 10 - Fedora 32 with 3 lines for Fedora generated by kernel update and 1 line for Window 10 boot loader) and starts a fresh new session.
For swap I believe I allocated a very generous amount of memory to that partition (37GB in a machine with 16GB RAM) so surely there is enough space.
I do not exactly know what you mean by grub boot flags and allowing to write memory to swap partition but I attached below (partial) output of fdisk -l output, ls -l on the swap partition and grub file content.
If you could guide me further on how to make the hibernate work I would be most grateful.
Hmm. I'll have to assume that /dev/mapper/fedora-swap works in this case as I've set mine up to resume using the swap partition's UUID. e.g. resume=UUID=12345678-abcd-ef01-2345-6789abcdef01. Not sure if that's worth a
In my case that was enough, when combined with systemctl hibernate to get it to hibernate. The system appears to completely shut down, but when I reboot it and the resume arg is picked up, I get dropped back to my desktop with whatever programs were running before I shut the machine down. The output of dmesg then contains ACPI: Waking up from system sleep state S4.
Other things that I changed, to make sure that my system never attempted to suspend:
/etc/systemd/sleep.conf: