Consistent Wake from Sleep Issues on Linux Edit:(5x Distros Tested)

This is happening with me after I switched to a Crucial P5 NVMe drive (CT500P5SSD8) on Fedora, Arch, and Ubuntu all latest versions. Before had, I was running a WD SN750 and had no problems with sleeping and waking my laptop after closing the lid.

Just a follow-up post to say that kernel 5.15.5 on Pop!_OS 21.10 appears to have fixed the issue for me. I can now suspend and wake right away (without hibernate, which took about 5-8 seconds to load from disk)!

@Duane_Johnson Excellent news! Was this a fresh install or an upgrade from 21.04? Are you using the mem_sleep_default=deep boot parameter?

This was an upgrade from 21.04. I removed the mem_sleep_default=deep boot param that I had to use previously.

Just want to ditto this . Recently got the WD SN850 NVME and I no longer have these issues with my Ubuntu 21.10. Unfortunately something with the Crucial P5 is causing problems.

Ah.

Aaaah…

In my extensive post on SSD power consumption, I noticed that WD drives have two “low power” state – one when the computer is in S4 and the other for when it is in S3 (and perhaps other sleep states) – and only WD drive have this info on the datasheet.

My thinking is that the Crucial, like Samsung and many others, do not have the modern sleep state support (or the old sleep state support) WD drives possesses, and thus when Linux tried to perhaps sleep the device it would … well, cause troubles.

My next drive is going to be a WD. Noted!



Does your current installment (with WD) have any other issues? I don’t think so as NVMe is pretty generic a protocol. Compared to the “modern sleep”/“low power idle” madness.

1 Like

No, after swapping to WD it worked smoothly. Suspending and resuming worked fine, with no problems at all caused by the WD.

2 Likes

I do want to bump the thread for a quick update, that it seems that the latest linux kernel 5.16.* seems to introduce this suspend and can’t wake issue. This also affects my Western Digital SN850. I had to use the 5.15.* kernel and it is fine again, I can suspend and resume with no problems.

I mention this, for anyone who likes to play around with the latest kernel, especially since Linux 5.16.7 has been marked “Stable” : https://www.kernel.org/

Further links:

interesting. Maybe your hynix works now?
I wonder if there is a sleep state config in BIOS/Linux Kernel…

I see lots of people with excessive and quick linux power drain during sleep, I really don’t think its a hardware issue. Maybe Framework can chime in?

Power drain isn’t realted to battery (cell) degredation.

The suspend power drain Linux users are seeing is definitely not hardware related.

It might cause increased degradation over years due to excess cycling, but that’s about it.

2 Likes

Ah, if it’s during sleep, you can try a few things:

  1. Enable deep sleep (search here on the forums, you have to add a kernel parameter). This is in contrast to s2idle, which uses a lot more power.
  2. Enable and use hibernation. This is my preferred solution for any extended ‘sleeping’, since it uses next-to-no battery (especially when the battery is still new like it is in all Frameworks).

I’ve setup my power button to hibernate and lid closure to trigger deep sleep. If I’m going to be away from my laptop for any extended period of time, I trigger hibernation.

It’s not perfect, but it certainly greatly increases the time I can go between charges when I’m not using it.

2 Likes

Interesting.
I have set my power button to sleep and lid to do nothing.
Because I feel like that when you are telling the device to hibernate chances are that you have lots of time (to go into the power menu and click on “hibernate”), whereas if you have lots of tasks and don’t even have the time to hit the power button, you probably don’t need to sleep it anyway.
I wish there are the hibernation buttons of the old days. Some USB keyboard still have them, which is odd enough.

It’s using deep sleep.

It’s not about time (for me, anyway). It’s about convenience. I use a Wayland compositor (not a DE), so I don’t even have a ‘power menu’ of any kind. This means I have to trigger hibernation using the terminal (which is fine, I actually prefer it because I know exactly what’s going on and I have full control). While this is nice for control, it does mean that it’s slightly more inconvenient than, say, tapping a button. And since I use hibernation quite often for powersavings (for example, I pretty much always hibernate overnight, and even most of the time during the day when I’m not using it), it’s useful to be able to trigger it easily.

As for setting the lid action to ‘sleep’, that’s for those times where I don’t need to keep it closed for that long, but where not doing something just feels wasteful. For example, if I’ll be gone for 10–20 minutes or if I’m moving the laptop, I’ll put it in sleep (‘deep sleep’, not s2idle).

1 Like

It’s honestly funny to me that Linux distros seem to deal with this much better than recent Windows versions. Like, on Debian, I just change a few config settings and boom, my laptop is hibernating when I ask it to, no questions asked. Want to change it to suspend instead? Easy, just toggle one setting. Want to change the sleep method? Just add one kernel parameter and then you don’t have to think about it.

After I set the kernel parameter and edited /etc/systemd/logind.conf, I literally don’t have to think about suspend/hibernate/etc anymore. I press the power button and it hibernates (like I asked it to). I close the lid and it suspends in deep sleep (like I asked it to). I can manually issue poweroff and reboot commands when I desire and it will just…do the right thing.

2 Likes

Nah, this is mostly on the OS Windows and on Intel. Intel for refusing to support the standard sleep states. Windows for being such a clusterf*ck when it comes to suspend/hibernate/etc (and refusing to give control to the user).

On Linux, there might be other issues (though I’ve generally had a decently good time), but suspend/hibernate/etc works fairly well, it seems. Things hibernate when you ask them to. Things suspend when you ask them to. And things poweroff/reboot when you ask them to.

1 Like

For my part, I’ve heard a few things about the Intel side:

  • They have had bugs with suspend/resume for years
  • Tiger Lake’s sleep is much less efficient than previous generations, bringing the new additional complexity of deep sleep
  • The architecture is not yet fully power-optimized

Linux has never been about zero bumps in the road, but about giving you the tools to either fix it yourself or collaborate with those with the know how to do so.

Deep sleep and hibernate were working for me with less than 3 minutes of effort total on EndeavourOS (arch based).

eGPU handing in Linux still needs some serious polish, but it’s daily driver functional with minor quirks in X11. Wayland seems to be taking giant steps backwards in the last month or two though.

It’s not a hardware problem. Period.

1 Like

Expecting every user to be a programmer or computer engineer will do nothing to drive Linux to mainstream. I like the flexibility Linux offers but I understand hesitancy surrounding convincing my friends because none of them want to spend time “fixing” a computer. I like to tinker so it bothers me not a whit. I understand people who don’t wish to tinker. Gatekeeping will not bring about the age of Linux on desktop dominance. Perhaps the Steam Deck will if the UX is good, I pray it is.

2 Likes