Skip to contentSkip to conversation

Dell D810 Laptop Suspend/Resume

DISCUSSION Davy Durham 2 participants 5 messages Apr 21, 2005 – Apr 23, 2005

lore
Share & tools
lore
#0 lore raw

Hi,
I've been trying for the last few days to get my D810 to suspend and
resume in linux.

I'm doing it from klaptop in kde using Fedora Core 3, but I've now compiled my own linux-2.6.12-rc2-mm3 kernel since I've seen some ACPI changes going in.

At 2.6.11 it would seem to suspend ok, but when doing the resume it would come back and have I/O errors.. causing the computer to freeze for a few seconds, then run for a second, then freeze again, etc.. the HDD light would stay on solid, and at the tty1 I saw something like "ata1: command 0xc8 timeout... I/O error..." So apparently something isn't getting starting back up. Thinking it might be the HDD not spinning, I powered off, but DID hear it spin down.

Running what I compiled, 2.6.12-rc2-mm3, the suspend happens a little faster but the resume comes to a blank screen, then immediately reboots without any messages that I can see.

I'm very interested in getting this to work and will do whatever someone needs to gather information.

I may need to ask basic kernel info questions when asked to do something as I haven't done much trouble shooting at this low a level before but I'm game. From googling around this is a problem for many and I would like to help resolve it.

Any ideas?

Thanks,
Davy

#1 lore raw
Quoted 8 lines · Davy Durham

I've been trying for the last few days to get my D810 to suspend and resume
in linux.

At 2.6.11 it would seem to suspend ok, but when doing the resume it would come back and have I/O errors.. causing the computer to freeze for a few seconds, then run for a second, then freeze again, etc.. the HDD light would stay on solid, and at the tty1 I saw something like "ata1: command 0xc8 timeout... I/O error..."

It sounds like one of your drivers has a bad interaction with suspend2disc. By the way, we are talking about suspend to disc, not suspend to RAM, right? I've given up on trying to make suspend2RAM work, since kernel 2.4.20, although Linux does the same steps for both and it ought to work (or fail) equally.

You mention complaints about ata1, implying that you have a SATA primary disc. Given that it's a Dell system, I'm pretty sure you have an Intel chipset of one level or another, so you're using the module ata_piix and its scsi friends, which are loaded in an initrd, unless you've hardwired them into your kernel. Now we get into branches:

A. If you use an initrd, then you should see a message "resume failed..." before the initrd runs. In SuSE 9.3, which is just out and which uses kernel 2.6.11.4-rc(something), possibly with advance SuSE hacks, their initrd loads the drivers (ata_piix etc) needed to read the suspend image, then does the magic incantation (which I'm not going to recite from memory and mess someone up if I make a mistake), and resume then works. To debug this, purge the initrd of all drivers except ata_piix and its dependencies, and your ext3 or Reiser module if used (if not already done). Boot with the -b switch so no init scripts are run and no drivers are loaded by them. Mount -t sysfs sysfs /sys; then echo disk > /sys/power/state (to suspend). See if you can resume in this configuration with the absolute minimum of drivers. If so, load your usual drivers manually, one by one, until you find the culprit. It's OK to load drivers off a readonly filesystem.

B. If drivers are hardwired in your kernel, adapt the above instructions but don't hardwire any drivers except ata_piix and friends, and the filesystem driver if needed.

Given the symptoms, most likely it will still fail. Did you make the patch that lets you do DMA on your PATA ATAPI device (CD drive)? Those are "experimental", i.e. not officially released by Jeff Garzik. On kernel 2.6.12-rc1 I had no problems suspending with PATA ATAPI engaged, but with my chipset, ata_piix died horribly at initialization on 2.6.8 (didn't even get to trying suspend). To see what your distro gave you, look at /usr/src/linux/include/linux/libata.h; search for ATA_ENABLE_ATAPI and ATA_ENABLE_PATA and see if they're defined. In SuSE 9.3 (kernel 2.6.11.4-rc(something)) these are turned on. See here:

    http://www.math.ucla.edu/~jimc/insp6000/ata_piix-2.6.12-rc1.txt

for a patch to the code that recognizes "combined mode" on the ICH-6M chipset for my laptop; probably irrelevant for a desktop system.

Alternatively, do you have a proprietary graphics driver: nVidia or fglrx (for ATI Radeon)? Fglrx-8.12.10 on kernel 2.6.8 gave symptoms very similar to yours when I tried to resume, and if I remember right, the nVidia driver is not much better.

On a successful resume on kernel 2.6.8, with my particular gaggle of drivers, I have a 30 second timeout during reinitialization and I wasn't able to track it down to a specific driver. In testing SuSE 9.3 I haven't gotten far enough to see whether the timeout is still there. It's annoying but harmless (I hope).

I hope some of this helps!

James F. Carter Voice 310 825 2897 FAX 310 206 6673
UCLA-Mathnet; 6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA 90095-1555
Email: [email protected] http://www.math.ucla.edu/~jimc (q.v. for PGP key)

#2 lore raw
Quoted 14 lines · Jim Carter
Quoted 10 lines · Davy Durham

I've been trying for the last few days to get my D810 to suspend and resume
in linux.

At 2.6.11 it would seem to suspend ok, but when doing the resume it would come back and have I/O errors.. causing the computer to freeze for a few seconds, then run for a second, then freeze again, etc.. the HDD light would stay on solid, and at the tty1 I saw something like "ata1: command 0xc8 timeout... I/O error..."

Quoted 5 lines

It sounds like one of your drivers has a bad interaction with suspend2disc.
By the way, we are talking about suspend to disc, not suspend to RAM, right? I've given up on trying to make suspend2RAM work, since kernel 2.4.20, although Linux does the same steps for both and it ought to work (or fail) equally.

Actually, I'm not sure if it's to ram or disk.. how can I tell? Best I know, klaptop's right-click menu's "Suspend" option. But I would like to know. Is this running some command line app that I can run manually?

Quoted 4 lines

You mention complaints about ata1, implying that you have a SATA primary disc. Given that it's a Dell system, I'm pretty sure you have an Intel chipset of one level or another, so you're using the module ata_piix and its scsi friends, which are loaded in an initrd, unless you've hardwired them into your kernel. Now we get into branches:

Yes, ata_piix is listed in lsmod with a "Used by" of 3

What's weird though is that if I pull out the drive it has many many pins on it implying that it's IDE and not SATA, but I guess it could be a hardware layer. However, my friend with the same model running WinXP lists the drive as IDE. Like I said, I'm using FC3 now, however the first thing I tried was Mandriva 2005 LE.. but it didn't even get past kernel loading in the setup process because of some SATA issue. Maybe a specific kernel version problem there.

Quoted 4 lines

A. If you use an initrd, then you should see a message "resume failed..." before the initrd runs. In SuSE 9.3, which is just out and which uses kernel 2.6.11.4-rc(something), possibly with advance SuSE hacks, their initrd loads the drivers (ata_piix etc) needed to read the suspend image, then does the magic incantation (which I'm not going to recite from memory and mess someone up if I make a mistake), and resume then works. To debug this, purge the initrd of all drivers except ata_piix and its dependencies, and your ext3 or Reiser module if used (if not already done). Boot with the -b switch so no init scripts are run and no drivers are loaded by them. Mount -t sysfs sysfs /sys; then echo disk > /sys/power/state (to suspend). See if you can resume in this configuration with the absolute minimum of drivers. If so, load your usual drivers manually, one by one, until you find the culprit. It's OK to load drivers off a readonly filesystem.

Being ignorant here of exactly how the linux's bootstraping and kernel loading works I do think initrd is being used. I see both:
initrd /boot/initrd-2.6.12-rc2-mm3.img
and
kernel /boot/vmlinuz-2.6.12-rc2-mm3 ...
entries in /etc/grub.conf (which is being used)

When would I see this "resume failed..." message? Right after hitting the power button after a suspend, or when it boots up the next time after a failed resume? I didn't notice one at the former (all happens too fast.. all I can see is a blip of a blinking cursor in text mode) and don't see one anywhere near the beginning process of the latter.

Quoted 8 lines

B. If drivers are hardwired in your kernel, adapt the above instructions but don't hardwire any drivers except ata_piix and friends, and the filesystem driver if needed.

Given the symptoms, most likely it will still fail. Did you make the patch that lets you do DMA on your PATA ATAPI device (CD drive)? Those are "experimental", i.e. not officially released by Jeff Garzik. On kernel 2.6.12-rc1 I had no problems suspending with PATA ATAPI engaged, but with my chipset, ata_piix died horribly at initialization on 2.6.8 (didn't even get to trying suspend). To see what your distro gave you, look at /usr/src/linux/include/linux/libata.h; search for ATA_ENABLE_ATAPI and ATA_ENABLE_PATA and see if they're defined. In SuSE 9.3 (kernel 2.6.11.4-rc(something)) these are turned on. See here:

   http://www.math.ucla.edu/~jimc/insp6000/ata_piix-2.6.12-rc1.txt

for a patch to the code that recognizes "combined mode" on the ICH-6M chipset for my laptop; probably irrelevant for a desktop system.

Well, this is a laptop here.. Um.. cdrom is /dev/hdc and 80gig HDD (PATA?/SATA? see above) is /dev/sda

I'm building my own kernel from source, although I'm taking the settings from the config that came with FC3

Seeing that the HDD light is stuck on after resuming in 2.6.11, I think it's not an ATAPI issue, but the HDD's driver. On 2.6.12 I don't know what is failing becauase it just immediately reboots after trying to resume..

Quoted 4 lines

Alternatively, do you have a proprietary graphics driver: nVidia or fglrx (for ATI Radeon)? Fglrx-8.12.10 on kernel 2.6.8 gave symptoms very similar to yours when I tried to resume, and if I remember right, the nVidia driver is not much better.

Nope, only what it built in. for ATI Radeon

Please advise...

Thanks,
Davy

#3 lore raw
Quoted 3 lines · Davy Durham

Actually, I'm not sure if it's to ram or disk.. how can I tell? Best I know,
klaptop's right-click menu's "Suspend" option. But I would like to know. Is
this running some command line app that I can run manually?

Now there's an interesting question. On my Inspiron 6000, the power light blinks sexily in S4 (suspend to RAM) state, whereas the machine is completely powered off in suspend to disc. Assuming you still have Windows on your machine, for them "suspend" means to RAM whereas "hibernate" means to disc. You could see which lights remain on, if any, after you suspend Windows.

Klaptop may fork a command-line process or may do the mid-level signalling itself. Candidates are "shutdown -z", or if "powersaved" is running, then you get more features if you do "powersave -U" (not -u, which is suspend to RAM). Ultimately both of these will do "echo disk > /sys/power/state" to trigger the actual suspension. (or echo mem, if you want to try it.) It's "safe" to do the echo command. Note that the UNIX clock doesn't run while the machine is asleep. If I remember correctly, "powersave -U" but not "shutdown -z" saves the UNIX clock in the hardware clock, and reloads it after resuming.

Hmm, no it is not "safe" to suspend on your system. See below.

Quoted 5 lines

Yes, ata_piix is listed in lsmod with a "Used by" of 3

What's weird though is that if I pull out the drive it has many many pins on it implying that it's IDE and not SATA, but I guess it could be a hardware layer.

My own drive matches your description, but it's definitely doing SATA. I wouldn't be surprised if all the laptop drives have a PATA connector on them, and both PATA and SATA capability in the firmware, but the OEM (Dell? Fujitsu?) can put in a jumper to use either protocol according to how the motherboard is wired up. On an ICH6 or ICH6M chipset the 82801 can handle either protocol according to BIOS configuration, and of course the appropriate connectors.

Quoted 5 lines

However, my friend with the same model running WinXP lists the drive
as IDE. Like I said, I'm using FC3 now, however the first thing I tried was
Mandriva 2005 LE.. but it didn't even get past kernel loading in the setup process because of some SATA issue. Maybe a specific kernel version problem there.

If the installer wasn't smart enough to load the ata_piix driver, it would not be able to even touch the disc. Maybe you have to tell it what driver to load. SuSE's installer needs to be told about RAID cards, for example.

Quoted 6 lines

Being ignorant here of exactly how the linux's bootstraping and kernel loading works I do think initrd is being used. I see both:

   initrd /boot/initrd-2.6.12-rc2-mm3.img

and
kernel /boot/vmlinuz-2.6.12-rc2-mm3 ...
entries in /etc/grub.conf (which is being used)

Yes, that's them. Grub stage 2 uses BIOS reading (slow) to copy both of those into memory. The kernel initializes a zillion things including all the drivers that are hardwired. Then as the third-to-last step, it decompresses the initrd, mounts it, and executes "linuxrc", which does whatever it does: in most cases, just loads a few key modules, but for SuSE the installer and the rescue system are in two big bloated initrd images. When linuxrc exits the initrd is freed, the root filesystem is mounted, and init is exec'd. Then the boot scripts start running, after which you can do useful work.

Quoted 1 line

When would I see this "resume failed..." message?

Just before the initrd steps, on a normal (non-resume) boot. The message is kind of lame; of course it's going to fail because there's no resume image in the swap area, on a normal boot. Since the messages fly by very fast, look in /var/log/boot.msg or /var/log/boot.omsg, after booting. Assuming you were able to boot.

Quoted 2 lines

Well, this is a laptop here.. Um.. cdrom is /dev/hdc and 80gig HDD (PATA?/SATA? see above) is /dev/sda

OK, the ATAPI patches are _not_ engaged, otherwise ata_piix would have attached the CD as /dev/sr0. And ata_piix _is_ talking SATA to the primary drive. Without the patch it is not possible to do DMA on your CD drive, which precludes using the burner feature (if any).

Nasty consequence: when the kernel tries to read the resume image from your primary disc, it has no driver. So it prints an error code ultimately meaning "no such device" and continues with normal booting, specifically doing the initrd.

Pavel Machek, starting in kernel 2.6.11.something, put in a feature where (after loading the needed drivers) you could set the device number of the swap partition, then echo resume > /sys/power/state. In SuSE 9.3 the initrd finishes with this magic incantation. In checking out SuSE 9.3 last night I wasn't able to get to that step, but I'm virtually certain that it will work well.

Quoted 3 lines

Seeing that the HDD light is stuck on after resuming in 2.6.11, I think it's not an ATAPI issue, but the HDD's driver. On 2.6.12 I don't know what is failing becauase it just immediately reboots after trying to resume..

Maybe we should be sure that it's suspending to disc, not to RAM. The symptom is very reminiscent of a suspend2ram screwup.

James F. Carter Voice 310 825 2897 FAX 310 206 6673
UCLA-Mathnet; 6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA 90095-1555
Email: [email protected] http://www.math.ucla.edu/~jimc (q.v. for PGP key)

#4 lore raw
Quoted 13 lines · Jim Carter
Quoted 5 lines · Davy Durham

Actually, I'm not sure if it's to ram or disk.. how can I tell? Best I know,
klaptop's right-click menu's "Suspend" option. But I would like to know. Is
this running some command line app that I can run manually?

Now there's an interesting question. On my Inspiron 6000, the power light blinks sexily in S4 (suspend to RAM) state, whereas the machine is completely powered off in suspend to disc. Assuming you still have Windows on your machine, for them "suspend" means to RAM whereas "hibernate" means to disc. You could see which lights remain on, if any, after you suspend Windows.

My power light is fading in and out on the suspended state.. so I guess it's to ram. Plus, the suspend process is a matter of 5 or 6 seconds and not much disk activity.

Quoted 5 lines

Klaptop may fork a command-line process or may do the mid-level signalling itself. Candidates are "shutdown -z", or if "powersaved" is running, then you get more features if you do "powersave -U" (not -u, which is suspend to RAM). Ultimately both of these will do "echo disk > /sys/power/state" to trigger the actual suspension. (or echo mem, if you want to try it.) It's "safe" to do the echo command. Note that the UNIX clock doesn't run while the machine is asleep. If I remember correctly, "powersave -U" but not "shutdown -z" saves the UNIX clock in the hardware clock, and reloads it after resuming.

Well, the echo didn't work for me so I gave up in that area. powersaved is not running, and shutdown -z gives usage (as if -z isn't a valid flag)

Quoted 9 lines
Quoted 8 lines

Being ignorant here of exactly how the linux's bootstraping and kernel loading works I do think initrd is being used. I see both:
initrd /boot/initrd-2.6.12-rc2-mm3.img
and
kernel /boot/vmlinuz-2.6.12-rc2-mm3 ...
entries in /etc/grub.conf (which is being used)

Quoted 6 lines

Yes, that's them. Grub stage 2 uses BIOS reading (slow) to copy both of those into memory. The kernel initializes a zillion things including all the drivers that are hardwired. Then as the third-to-last step, it decompresses the initrd, mounts it, and executes "linuxrc", which does whatever it does: in most cases, just loads a few key modules, but for SuSE the installer and the rescue system are in two big bloated initrd images. When linuxrc exits the initrd is freed, the root filesystem is mounted, and
init is exec'd. Then the boot scripts start running, after which you can do useful work.

nice to know.. thanks.. and I'd switch to lilo, but can't figure out how to do that easily in FC3 (I'm brand new to redhat.. used mdk for years tho)

Quoted 8 lines
Quoted 3 lines

When would I see this "resume failed..." message?

Just before the initrd steps, on a normal (non-resume) boot. The message is kind of lame; of course it's going to fail because there's no resume image in the swap area, on a normal boot. Since the messages fly by very fast, look in /var/log/boot.msg or /var/log/boot.omsg, after booting. Assuming you were able to boot.

I do not see this in log or at startup. oh well

Quoted 9 lines
Quoted 4 lines

Well, this is a laptop here.. Um.. cdrom is /dev/hdc and 80gig HDD (PATA?/SATA? see above) is /dev/sda

OK, the ATAPI patches are _not_ engaged, otherwise ata_piix would have attached the CD as /dev/sr0. And ata_piix _is_ talking SATA to the primary drive. Without the patch it is not possible to do DMA on your CD drive, which precludes using the burner feature (if any).

That's okay, I'm not trying to fry that fish right now.

Quoted 4 lines

Nasty consequence: when the kernel tries to read the resume image from your primary disc, it has no driver. So it prints an error code ultimately meaning "no such device" and continues with normal booting, specifically doing the initrd.

Apparently not doing suspend-to-disk right now I guess this is moot.. but I'm going to try hibernate instead to see if there's any difference.

Quoted 4 lines

Pavel Machek, starting in kernel 2.6.11.something, put in a feature where (after loading the needed drivers) you could set the device number of the swap partition, then echo resume > /sys/power/state. In SuSE 9.3 the initrd finishes with this magic incantation. In checking out SuSE 9.3 last night I wasn't able to get to that step, but I'm virtually certain that it will work well.

I wish I could figure out where to get SuSE 9.3 without forking out $100.. I might be willing to if I knew 9.3 would work for me. I guess I could try the live disc, but dunno if the boxed set would work even if the live disc did. FTP installs are fine for me with 4Mx2M internet connection.

Quoted 10 lines
Quoted 5 lines

Seeing that the HDD light is stuck on after resuming in 2.6.11, I think it's not an ATAPI issue, but the HDD's driver. On 2.6.12 I don't know what is failing becauase it just immediately reboots after trying to resume..

Maybe we should be sure that it's suspending to disc, not to RAM. The symptom is very reminiscent of a suspend2ram screwup.

It's not.. so I'm about to try that.

Also, I'm getting a few other replies talking about a guy working on the SATA driver's support for that as we speak.. I plan to get in touch with him too.

Thanks,
Davy