What's Brewing
Randy's thoughts on Beer and the power of Software
All | Brewing | Drivers | General | PM | Webmin

20080101 Tuesday January 01, 2008

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.

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 or driver-discuss-AT-opensolaris-DOT-org.


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.


( Jan 01 2008, 06:17:33 PM PST ) Permalink Comments [7]

Trackback URL: http://blogs.sun.com/randyf/entry/solaris_suspend_and_resume_how
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 20, 2008 at 05:05 AM 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 08: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 09: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 10: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 11: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 08: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 07:52 AM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed

Archives
Language
Links
Referrers