Why suspend-to-RAM will never work perfectly on Linux

When Apple introduced “sleep” especially on its laptops, it raised the bar in the industry because people loved the feature. The feature existed before but Apple really made it one of the reasons why someone would want a Mac laptop.

For the last few years Linux users are ranting about the sub-standard support of “sleep”. Compatibility is better these days, but still not great. Thing is, it will never be.

Apple only deals with a very specific set of hardware parts that has total control of most of the time, and Microsoft certifies most third party drivers. These two reasons are good enough to deliver a good suspend-to-RAM support. But Linux has no such certification program (if a driver is deemed “stable” it gets in the kernel without questions), it has to deal with vast amounts of hardware models and it doesn’t have good “workarounds” for buggy BIOSes either.

This will never change. There is never going to be good-enough “sleep” when using Linux — except if Intel creates a new BIOS/hardware standard that pushes developers to write drivers the right way.

On my new laptop, 1 out of 10 wake ups is screwed up: gfx can’t wake up, network card can’t be re-initialized, or if I leave it sleep for more than 3-4 hours it never wakes up again. Honestly, even if these weird cases get fixed in 3 years time, by then the same problems will be for newer laptops. So, I don’t keep my hopes high that sleep will work out of the box for any given hardware.

Update: Here’s a new one tonight: laptop comes back from sleep, regains network connection and everything, only to go back to sleep all by itself 10 seconds later.

27 Comments »

Tom Dison wrote on March 21st, 2007 at 3:14 AM PST:

I really hate it when people say “Well, it works for me, what’s yor problem”. I too have had multiple laptops – Sony, Compaq, etc. and none of them have worked for sleep. Occasioanlly, hibernate would work, but who wants to wait for everything to start up again. Neither works on my current laptop.

Stop blaming the customer. I know it works on some laptops. But not the majority, and it is not the consumer’s fault. Period!

[Deep Breath]

Aaaarrrrgggggghhhh!


Pau wrote on March 21st, 2007 at 3:18 AM PST:

OF COURSE suspend MUST work in mac laptops… They produce ONE kind of hw with ONE kind of software

Imagine a linux distro taking over the market (for instance, Oracle’s …hawhaw) and imagine that they produce ONE kind of laptop…

You can bet suspend would _always_ work.

What happens in real life? You have more than 500 distros and more than… 1000 laptop kinds of hw?


Tom Dison wrote on March 21st, 2007 at 3:33 AM PST:

That was exactly Eugenia’s point. And that is a strength that Mac has purposely maintained. Meanwhile, PC’s have let everyone in the game, so prices are lower. But things don’t always work together.

However, the same collection of hardware DOES sleep and suspend under Windows, so it is possible. But the collaboration between vendors and Microsoft is very close. Om the Linux side, it is the lone developers trying to reverse engineer bioses and drivers. The odds really aren’t in their favor.

All of this goes away if Linux becomes a mainstream OS, because then the hardware vendors would work closely with the kernel guys to make sure everything works. May never happen.

Nevertheless, the PC will never work as well as a Mac solely because of the control Mac has over the selection of hardware, etc. They can guarantee it works. As long as there is a 3rd-party wireless card from Timbuktu that can be inserted in a PC, it will always have some struggles with everything working smoothly.


Pau wrote on March 21st, 2007 at 3:46 AM PST:

well, then switch to openbsd… once they have finished coding acpi and fully implemented it, you can bet it *will* work. They don’t ship things because they just compile. They ship things when they are Sure (note the capital) that it’s good code


Tom Dison wrote on March 21st, 2007 at 4:33 AM PST:

And that is why I use OpenBSD on a lot of my laptops. However, it would be very hard for a new implementation to work on all laptops – the problem is that a lot if Bioses have very buggy implementations, so the driver has to work around all of these flaws. Nevertheless, I will definitely be giving 4.1 a spin on some of my laptops to see how it goes. Initially, my guess is that they will just get frequency scaling and battery status to work, and then try to get sleep/hibernate at some future time (possibly), but we will see.


Tom Dison wrote on March 21st, 2007 at 4:35 AM PST:

Also, as far as I know, OpenBSD has zero OpenGL/Dri/3D support for video, and probably isn’t going to. That really isn’t their focus.


Pau wrote on March 21st, 2007 at 4:38 AM PST:

and who needs 3D stuff? if you like gaming go to windows; you’ll feel much more comfortable… beryl etc is nice but useless…
I only use OpenBSD


Tom Dison wrote on March 21st, 2007 at 5:00 AM PST:

Fortunately, I am able to run my one Windows game – Half-life 1 – under Linux using Wine. It keeps me from having to boot into Windows. I’m glad 3D is working for me in Ubintu.

Other than that, I agree that the whole 3D hype is a bit over-blown, but I’m not sure you can “put the genie back in the bottle”. People do not like giving up features, so 3D will need to come eventually. I know it works on FreeBSD and NetBSD, so it should also be able to come to OpenBSD.


aussiebear wrote on March 21st, 2007 at 6:40 AM PST:

I find it odd that you’re making a generalisation based on one laptop experience. You never mentioned what model your laptop is, or what distro you are using! How did you set it up?

I’ll tell you what I’m using:

* IBM ThinkPad R40
* ATI Mobility Radeon 7500
* Realtek Gigabit Ethernet PCMICA card (because the one on the notebook is busted)
* Arch Linux 0.8 (upgraded from 0.7 install)

In Arch Linux, I had to manually install the power saving components and the power saving version of the kernel in myself.

Suspend-to-RAM works for me. Everything goes to sleep and wakes up correctly. I put it to sleep, leave it for 12 hours, come back, wake it back up. Everything re-initializes correctly. Video, network, etc.

Its been so well for me, I’ve modified my setup such that Suspend-to-RAM is backed up by Suspend-to-Disk.

I tested this by putting it to Suspend-to-RAM, then pulling the battery and the power brick out. Waited 24 hours, and then plugged the power back in. It re-initialized correctly.

What I mainly disagree with, is your tone. You make it sound like there is absolutely no hope. SHAME ON YOU! Do you not realise there is ALWAYS hope on the open-source side? One potential option is to replace the BIOS completely with LinuxBIOS. (Its been used by the OLPC project).


This is the admin speaking...
Eugenia wrote on March 21st, 2007 at 6:48 AM PST:

Aussiebear, keep dreaming about LinuxBIOS and other such things that will never happen for the average consumer.

Also, I did not make generalizations based on 1 laptop, but on my experience with FIVE laptops and FOUR desktops that run or ran Linux in the last few years in my lab.

And please let me make it absolutely CLEAR to you WHY your IBM laptop works so well with sleep: because that’s what the Intel engineers used to re-write ACPI on the Linux kernel.

You see, about 3 years ago the ACPI code was re-written on Linux. The people who did the work were Intel engineers, a project paid by Intel in particular. Intel gives IBM laptops to ALL of its engineers. So when the new ACPI code came around, the IBM laptops where the BEST regarding sleep support. All of the affected drivers got patches too where needed.

But point of the matter is, not everyone uses IBM. I don’t. Neither is Intel continue to work on this project for new Lenovo/IBM laptops. So there is a good chance that the newest IBM laptops will experience similar problems to the DELL ones.


gfdsa wrote on March 21st, 2007 at 7:39 AM PST:

Toshiba satellite A100, Core 2 Duo, ATI,Radeon Mobility X1600,Intel(R) PRO/100 VE, 2.6.20 x86_64, fglrx 8.34.8 [Feb 20 2007]
ususpend both to disk and ram.
did not spend nights on it, worked from the first time following online step-by-step guide.
Bottom line:
Don’t by shitty laptops. I do remember terrible problems with Acer ACPI which I could never solve. I do remeber first month of fighting with Asus one. But IBM just worked, and now I have this toshiba for 5 or 4 months, and it’s just working.
Take a break, launch `make menuconfig` and just for a start, chack how many ACPI and APM workarounds are there for different manufacturers. Windows will never standby or hibernate on these without a driver that came with hardware.
So we came back were it all started a decade ago, nag your manufacturer to release specifications.


Tom Dison wrote on March 21st, 2007 at 7:49 AM PST:

Here’s a new one tonight: laptop comes back from sleep, regains network connection and everything, only to go back to sleep all by itself 10 seconds later

I think that is called “nap” mode ;}


This is the admin speaking...
Eugenia wrote on March 21st, 2007 at 7:51 AM PST:

I don’t think that DELL’s laptops are shitty. Plus, the model I use has being around for some time to allow for bug fixes.


This is the admin speaking...
Eugenia wrote on March 21st, 2007 at 8:04 AM PST:

Tom: hehe ;-)


blag wrote on March 21st, 2007 at 8:23 AM PST:

I agree LinuxBIOS is the ideal future–not only Linux–but what about all the testing that _does_ go on? Like Ubuntu’s laptop-testing group?
Anyway, I know you’re all about submitting bugs so I’m sure you’ve sent some concerning this problem to Launchpad.


This is the admin speaking...
Eugenia wrote on March 21st, 2007 at 8:28 AM PST:

Of course I did. No reply yet. Neither they can really do anything as the problem involves more than 1 driver and it’s hard core kernel work.


trashcat wrote on March 21st, 2007 at 8:39 AM PST:

Dell laptops are pretty shitty. I can’t configure my DVD drive for DMA, the silver finish is coming off, and I’ve had it for less than a year, the DVD player makes a really loud noise now when it starts spinning fast, and the fans are getting louder…

but I got mine for %40 off, which more than makes up for it (and the screen is really pretty, and i really like the touchpad/buttons.


blag wrote on March 21st, 2007 at 8:56 AM PST:

btw I must say—what a surpise, it’s a Broadcom card.


blag wrote on March 21st, 2007 at 11:06 AM PST:

Eugenia–have you tried this program for photography needs?
It’s the free Linux version of this Windows/Mac suite.
I read about it in this review of Ubuntu and thought you and some others might be interested.


blag wrote on March 21st, 2007 at 8:38 AM PST:

I’ve had good luck with Canonical’s Ben Collins and problems that fixed my webcam driver, but you’re right; I’m sure he has more work to do packaging Ubuntu than fixing kernel bugs sadly..


fignew wrote on March 22nd, 2007 at 4:54 AM PST:

Suspend to disk & suspend to ram both work flawlessly here on my SHARP Widenote M4000. You see, Eugenia, Dell’s may not be bad laptops, but they sure don’t use fully standard ACPI procedures (I used to have a dell, and although it would suspend & resume, I would have to close & open the lid to get the screen to work again.)

(by the way, now that I think about it, my dell also had the “nap mode” problem ;) , I think I resolved it by using the keyboard suspend key instead of telling linux to suspend!) Does that work for you?


This is the admin speaking...
Eugenia wrote on March 22nd, 2007 at 6:25 AM PST:

The problem is not always buggy ACPI BIOS fignew, but usually it’s buggy drivers. This is also true for OSX’s sleep problems — yes we do have those in our PowerMac, because it has 6 extra third party drivers. My powerbook that doesn’t has only 1 extra driver, doesn’t have a problem (although there was a time that this driver did, until the developer fixed his bug).

My point: the real problem is drivers that were not designed with suspension in mind. And Linux has a lot of them.


Tom Dison wrote on March 22nd, 2007 at 8:11 AM PST:

Suspend to disk & suspend to ram both work flawlessly here on my SHARP Widenote M4000

That just thrills my heart every time I hear that line…
NOT!


blag wrote on March 22nd, 2007 at 9:57 AM PST:

I just want to say that (on my Pentium 3) Windows doesn’t work at all with Suspend on my hardware–it starts to suspend, monitor shuts off, and then the machine turns on again for some reason (however slow-ass hibernate does work, but same on Linux). On Linux both hibernate and suspend work though.


ArtInvent wrote on March 22nd, 2007 at 10:52 AM PST:

There are a number of pretty good solutions. Just emulate the Mac, that is, be selective about your own hardware. Linux’s strength is that it works on almost anything. It’s not the Linux dev’s fault if YOU have chosen just any old hardware and (surprise) not every last thing works. With Linux, that responsibility falls to the USER. First, buy a laptop that you know works with suspend/hibernate on your distro of choice. Check the Ubuntu laptop lists, or, buy a laptop that has Linux pre-installed and is guaranteed by the vendor to support sleep flawlessly. If you have some random old laptop and you can’t get it to work with sleep and that’s a deal breaker, sell it on eBay and buy one from the list that works with sleep and all the other things you need.

My Compaq 2100 (2002 vintage) doesn’t seem to work with sleep under Ubuntu. But then, it was never built nor intended to work with any flavor of Linux. My current solution is to dual boot, plus I built a second computer that’s fast-modern and that I don’t ever even turn off. The laptop continues to run XP (horrors) but I can pull up a full SSH graphical terminal off the new computer to run any Ubuntu program or file on that machine that I want at blazing speed. In future when that last XP program I need (for me it’s CorelDraw11) is no longer necessary, I will trade in for a laptop off the certified list.

Incidentally, this laptop went for a couple of years under XP where sleep didn’t work, so all has not been perfect in the Windows camp either.


Jonathan wrote on March 23rd, 2007 at 3:03 AM PST:

Your premise is wrong. My laptop does not SLEEP or HIBERNATE in Windows OR Linux. So Windows isn’t perfect ACPI either..


fignew wrote on March 26th, 2007 at 3:26 AM PST:

Tom Dison: feeling like an ass?


Comments are closed as this blog post is now archived.

Lines, paragraphs break automatically. HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

The URI to TrackBack this blog entry is this. And here is the RSS 2.0 for comments on this post.