Solaris Suspend and Resume: How To!

So, Solaris x86 machine are now capable of suspend and resume. The Ultra 20 is enabled by default, and a simple call via sys-suspend, and the machine will go to sleep in a few seconds. And simply pressing a key on the keyboard and the machine is back where it was left just a few seconds later.

"OK", you say, "this is cool, but I don't have an Ultra 20, will it work on my machine?"

The answer is Maybe!.

As mentioned before, suspend and resume primarily depends on hardware drivers supporting the DDI_SUSPEND/DDI_RESUME commands to their detach(9e)/attach(9e) routines. If these commands are supported on all the drivers on your machine (and the drivers actually restore the hardware state), then your machine just may also suspend and resume.

The first thing to do is to actually enable the feature on your machine. The Ultra 20 is enabled by default, and as other compliant machines are identified, they will be enabled by default. Everyone else that wants to try the feature will need to enable it by adding a line in /etc/power.conf:

S3-support enable

And then (as root or via the Administrator role) enter:

/usr/sbin/pmconfig

This will allow /usr/openwin/bin/sys-suspend to actually try and suspend the machine!

This is the point were we now find out if drivers comply or not. The cpr module will walk the device tree (as well as other things, but that is later) by going out the the leafs and calling their detach(9e) routines with the DDI_SUSPEND command. If the driver complies, it will return a DDI_SUCCESS, and goes to the next leaf (followed afterwards by the nexus driver). If it returns DDI_FAILURE, then we rewind through the list of already suspended devices, calling their attach(9e) routines with the DDI_RESUME command, and then returning a failure. As the late great Chick Hern used to say: "No Harm, No Foul".

If all the devices suspend, the cpr module will enable wakers, and call the ACPI _S3 method and go to sleep! Press a key on the keyboard, the power button (raise the lid, if you happen to have a driver for that event), or even Wake on LAN (BIOS configured WOL NIC's will enable Magic Packet WOL as part of the S3 method), and the machine wakes up.

Another note, OpenSolaris doesn't have the sys-suspend command. This is not a problem, as Gnome has Suspend and Resume support built in. In the "Menu", click on the "Shut Down" item, and if S3-support is enabled (either by the whitelist, or by the methods above), there will now be a "Suspend" button. Clicking on this button will also initiate a suspend/resume cycle.

A quick note of caution: enabling suspend and resume on machines without known compliant drivers can cause problems, including panics. So don't expect miracles. You can, however, file bugs against drivers that don't support suspend and resume. Looking through /var/adm/messages should let you know why a suspend failed, including if a driver failed.

And the nVidia driver that does support suspend and resume requires first that the Xorg server be running, so if you get a framebuffer driver failure and your hardware is using the nvidia driver, make sure that Xorg starts first. This is usually accomplished by just logging in via dt-login.

Also, initial support for suspend and resume disabled the feature if running more than one processor, as there were some interesting MP issues that required a bit more time to work out. So if you are also running 2 processors or a dual core, you will need to disable the second processor/core till this fix is integrated. (This was fixed in snv_82)

Need more information, keep watching this blog. I will post updates and other tricks. You can also follow the OpenSolaris.org Laptop Community's "Suspend and Resume" project, or even post questions to laptop-discuss-AT-opensolaris-DOT-org, driver-discuss-AT-opensolaris.org, or check out information in the Power Management Community.


Till then, how about a Gordon Birch "Winterbock". A nice malt body with a dark copper color and strong caramel flavor, with a spicy hop bitterness and alcohol content that will warm anyone on a cold winter night.

This seasonal lager will soon be gone, so stock up for the new year, and see if your x86 laptop will sleep while you enjoy this fine winter lager.


Comments:

hello,
i have Sun Ultra 20 with SXDE4. Using sys-suspend, the machine went to sleep, but unable to awake. The green led still flash slowly. The keybord is totally inactive. Finally, i have to reboot the machine.
Is it mandatory to install frkit and powernow?

Posted by gerard on March 19, 2008 at 10:05 PM PDT #

Hi Randy, when I add 'S3-support enable' to /etc/power.conf' on snv_b85 and run /usr/sbin/pmconfig, I see a message saying:

# /usr/sbin/pmconfig
/usr/sbin/pmconfig: "/etc/power.conf" line 20, unrecognized keyword "s3-support"
#

I have an AMD BE-2350 processor, which is a dual-core 64 bit processor, but you say that the dual-core issue was fixed in snv_b82. However, the message does seem to point to an incorrectly specified parameter -- i.e. the 'S3-support enable'

Any ideas?

Posted by Simon Breden on April 05, 2008 at 01:35 AM PDT #

Simon-

The 'power.conf' file is case sensitive. From the error-message, it looks like you have 's3-support enable', and it should be 'S3-support enable'.

I suspect that there should be an RFE to remove case sensitivity (and I will likely file one soon), but right now it is case sensitive, so be careful of the case.

Gerard-

I don't remember if it is actually true of the U20, but some USB interfaces are different than others, and are not configured to stay hot during S3. I will verify the next time I have access to a test machine, but try plugging the keyboard into the back ports. And/or see if the power button will wake the machine. If neither of these work, contact me directly and I will see if we can work out what the problem is and get it fixed.

Posted by Randy Fishel on April 05, 2008 at 02:35 AM PDT #

Thank for the quick reply Randy!

OK, my fault, and now I have made the 'S' upper case. I did a 'tail -f /var/adm/messages' and see this output in the logfile now when I run /usr/sbin/pmconfig:

Apr 5 19:36:35 solarisbox /usr/lib/power/powerd: [ID 387247 daemon.error] Able to open /dev/srn

Any ideas what this could be? One step nearer... :)

Posted by Simon Breden on April 05, 2008 at 03:42 AM PDT #

Quick update: although I saw the message last reported in the system log file, I then tried out activating the suspend mode, by hitting the power button for < 4 secs, and for the first time, this Solaris machine finally went into suspend mode. Screen went off, disks spun down, front panel LED on machine flashed, and power meter showed around 20W instead of 120W of power consumption. So, it looks like success.

However, then I did not manage to wake it up, and now I will reboot it and see if I can find out anything -- is this the right file to inspect? Be back later...

Posted by Simon Breden on April 05, 2008 at 04:13 AM PDT #

Randy, I managed to get no further making the resume work, so I posted to the OpenSolaris:discuss group here asking for any info anyone has:
http://www.opensolaris.org/jive/thread.jspa?threadID=56623&tstart=0

Thanks for a useful blog entry that got the suspend to work. Now I just need the resume to work too :)

Simon

Posted by Simon Breden on April 06, 2008 at 01:12 AM PDT #

I have an AMD64-based Solaris box with neither /etc/power.conf nor /usr/sbin/pmconfig. What package should I install, and where do I download it?

Posted by niq on May 11, 2008 at 12:52 AM PDT #

Would be nice to know how to REMOVE all the things that make the machine go to sleep.

Posted by Evgeny on June 04, 2008 at 11:17 PM PDT #

So.. Suspend works great on my Toshiba M400 :) =D ... But.. where might I get sys-suspend or similar so that I might be able to suspend from the command line (or really .. anything not-gnome.. kde,fluxbox,ion3 etc)

Posted by Lee Burton on October 16, 2008 at 07:26 AM PDT #

So.. Suspend works great on my Toshiba M400 :) =D ... But.. where might I get sys-suspend or similar so that I might be able to suspend from the command line (or really .. anything not-gnome.. kde,fluxbox,ion3 etc)

Posted by Lee Burton on October 16, 2008 at 07:26 AM PDT #

Data point. System suspend is working on my ThinkPad T61 and OpenSolaris 2008.11 RC1 (b101a) - BUT ONLY IF, I invoke the 'pmconfig' on each fresh boot. If I boot fresh without 'pmconfig' and attempt as suspend, it'll hang instead. Granted this is pre-release software, but has an easy work-around.

Posted by Wes Williams on November 11, 2008 at 05:44 AM PST #

Hello,

My name is Ken Okubo. Japanese.
I am from OpenSolaris community and Sun contributor (SCA No. OS0322)
Mainly, my contribution is Globalization (translation into Japanese).
I have reviewed the Japanese translation of “Getting Started With OpenSolaris 2008.05” and “Release Notes for the OpenSolaris 2008.05 Release”.
http://blogs.sun.com/reiko/entry/%E5%85%A5%E9%96%80%E3%81%AE%E7%BF%BB%E8%A8%B3%E3%82%82%E5%AE%8C%E6%88%90_getting_started_guide_translated
I have translated several “man pages” of OpenSolaris command.
http://wikis.sun.com/display/g11n/Working+Table

As "What's New in OpenSolaris 2008.11" document point your blog for the reference, I would like to translate your blog into Japanese Language for the convenience of Japanese OpenSolaris users.
Please kindly grant permission for the translation.

Regards,

Ken Okubo
se5k-ookb@asahi-net.or.jp

Posted by Ken Okubo on November 27, 2008 at 04:29 PM PST #

RC2 has fixed whatever required invoking 'pmconfig' on each reboot. For the most part, suspend now works as expected. Great!

Posted by Wes W. on November 27, 2008 at 08:26 PM PST #

Hello,

on my Thinkpad T43 (2668xxx) suspend/resume does not work. I have made the described entry in /etc/power.conf.

Sorry to say this.

Best regards

Juergen

Posted by Juergen Dankoweit on December 22, 2008 at 12:55 AM PST #

Dude: sure doesn't look like my Dell Inspiron 530s has the right stuff to do this. As of opensolaris 0811. True?

Posted by Jon Krueger on January 02, 2009 at 10:44 AM PST #

Thanx,

This works smoothly on my Dell Latitude D620. Had to reboot tough in order for it to work !

Posted by Enno on January 03, 2009 at 06:31 AM PST #

The reboot made it work!!

Suspend is fast and reliable now on my box.

Posted by Jon Krueger on January 05, 2009 at 10:24 AM PST #

hello,

I have just made all the changes to my OS 2008.11 on Sony Vaio VGN-FE28H but after writing (under superuser account) "/usr/sbin/pmconfig" nothing happens. Even "/var/adm/messages" stays clear. No messages...
Any ideas?

Posted by Michal Rozek on January 06, 2009 at 05:23 AM PST #

I would truely like to thank you both, I finally resolved my problem and now have my wireless card working on my D620. I went back as you suggested Dawid and just reinstalled and rebooted. But only after rebuilding the linux install and starting fresh and as Mike suggested installing the Kernel-Devel for my kernel as well that solved everything. Thanks again for all your feedback and this blog. Now on to the next issue to solve, getting my wireless to work at the office with their WPA setup. LOL.
http://www.batterygoshop.co.uk/dell/d620-battery.htm

Posted by laptop battery on January 14, 2009 at 09:41 PM PST #

where should i start debugging suspend in a laptop that enters suspend mode but does never wake up or print what the failing driver is?
the laptop is a dell 640m

Posted by nacho on February 24, 2009 at 08:52 AM PST #

Hi,

No idea how to debug this but my Lenovo X301 Suspends however never resumes fully.

Could you please take a look at this?

Thank You,
Edward.

Posted by EdwardO'Callaghan on April 23, 2009 at 07:07 PM PDT #

I am trying to suspend the Solaris 10 5/09 s10x_u7wos_08 X86 VMware Virtual Machine by editing "S3-support enable" in /etc/power.conf file; but when I execute the "/usr/sbin/pmconfig" command it gives error as "unrecognized keyword "S3-support"".
Also executed following commands to enable the ACPI but no success;

eeprom acpi-user-options=0x0
eeprom acpi-user-options=0x8

Tried "uadmin 3 20"; still no use.

#uname -a
SunOS unknown 5.10 Generic_139556-08 i86pc i386 i86pc

Host (Physical) Machine is Dell Optiplex 740 (AMD Athlon 64 X2 6000+)

Posted by vijay on July 09, 2009 at 05:20 PM PDT #

Does acpi s4 will have support for x86? I am a polar bear and my notebook should sleep with me ;).

Posted by Gabriel on September 02, 2009 at 05:38 AM PDT #

Does acpi s4 will have support for x86? I am a polar bear and my notebook should sleep with me ;).

Posted by Gabriel on September 02, 2009 at 05:38 AM PDT #

I tried everything mentioned above, and running pmconfig gave no messages appearing on the screen, just retuned, and running sys-suspend gaves:

suspend: Suspend is not supported.

Why? How to diagnose? Mine is a recent Lenovo R400 core2duo, and running OSOL snv 127.

Posted by Peter Teoh on November 30, 2009 at 03:47 PM PST #

I have received several similar emails like this one.

Posted by links london on December 01, 2009 at 09:50 AM PST #

I have a Thinkpad T41 running OpenSolaris 2009.06. I added the S3-support line to /etc/power.conf. However, when I try to suspend, I get an error about the floppy drive being in use, and/or not supporting suspend/resume. However, the laptop doesn't have a floppy drive! Is there a way to keep the system from looking at this?

Thanks

Posted by Rob French on March 03, 2010 at 01:14 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

randyf

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today