Bug 3599

Summary: S3: suspend hang - HP/Compaq nx7010/nw8000/nx5000, Compaq Presario X1000
Product: ACPI Reporter: Pierre Ossman (pierre-bugzilla)
Component: Power-Sleep-WakeAssignee: Shaohua (shaohua.li)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, mag, pierre-bugzilla, sayamindu, shaohua.li, vadim
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.5 through 2.6.9 Subsystem:
Regression: --- Bisected commit-id:
Attachments: Shutdown LAPIC at poweroff
Not disable bus arbiter

Description Pierre Ossman 2004-10-20 06:50:03 UTC
Distribution: Fedora Core 2
Hardware Environment: HP/Compaq nx7010
Software Environment:
Problem Description:

When the machine tries to enter S3 it just stops dead instead of suspending. It
does not shutdown the screen, start blinking the power LED so it doesn't seem
that it actually enters the state.

The problem is not that the kernel stops somewhere. It goes as far as writing to
the correct registers to enter the state. (One note is that it stops after
writing to the first of the two regs but this behaviour also exists for S5,
which works).

I've tried with no modules loaded and all (relevant anyway), with and without X.
The effect is the same.

The hardware also gets into some funky state when you do this. Restarting the
machine (holding down power of 4 sec) doesn't get it back up and running. It
starts most of the hardware but the screen isn't turned on so I figure it
crashes somewhere during BIOS startup. Restarting it a second time gets things
back to normal.

The problem has always been present since I bought the laptop. All stable
releases since 2.6.5 through 2.6.9 have been tested.

Steps to reproduce:

1. echo 3 > /proc/acpi/sleep
2. Watch the machine seem to enter suspend
2. Wait until hell freezes over before it actually suspends
Comment 1 Alexey Starikovskiy 2004-10-20 07:21:28 UTC
Created attachment 3866 [details]
Shutdown LAPIC at poweroff

Could you try this patch to see if it helps?
Comment 2 Pierre Ossman 2004-10-20 08:14:24 UTC
No effect. My system doesn't have an APIC though (the kernel can't find one at
least).
Comment 3 Venkatesh Pallipadi 2004-10-20 10:09:13 UTC
I have exactly same problem on Compaz Presario X1000. 

Only difference is in place of blinking LED, I see an orange LED when I try to 
suspend. I have been scratching my head over this for last couple of weeks.

I tested and found out too, that it hangs/halts after writing first register 
to enter S3. My guess is it is probably going into SMI and hanging there for 
whatever reason.
Comment 4 Len Brown 2004-11-04 01:26:55 UTC
how about if you try S4 instead of S3?

echo platform > /sys/power/disk
echo disk >/sys/power/state
Comment 5 Pierre Ossman 2004-11-04 02:40:00 UTC
Works fine. All hardware seems to function nicely after the machine resumes.

Reading the docs seem to suggest that the suspend uses S5, not S4 though? Bug3696 still rears its ugly head which seems to support this.
Comment 6 Venkatesh Pallipadi 2004-11-08 14:19:13 UTC
One more system with identical suspend resume behaviour. HP nw8000. 

Comments from bug #3354

------- Additional Comment #1 From Vadim Zeitlin 2004-10-10 08:15 ------- 
Distribution: any
Hardware: HP nw8000 (see
http://h18000.www1.hp.com/products/quickspecs/11798_na/11798_na.HTML)

I think I observe the same bug on another notebook, HP nw8000 with ATI FireGL 
T2
card. I've tried the following kernels: stock 2.6.4 from SuSE 9.1 (because this
one is ceritified by HP), 2.6.8-1 and 2.6.9-rc3 on Debian testing. In all 
cases,
all modules except the required ones (i.e. IDE ones), including USB, sound, ...
were unloaded although I did try it under X too, just in case. The symptoms are
always the same: machine goes to sleep successfully but can't be woken up 
except
by a hard reset. To reproduce, simply "echo mem > /sys/power/state".

In this thread on ACPI mailing list:
http://article.gmane.org/gmane.linux.acpi.devel/10113
I was told that it was probably a video card bug but I'm not sure about it
because the machine is completely dead when power button is pressed after it
suspends. The disk LED does light up but Caps Lock LED doesn't. Pinging it
doesn't work neither.

I'd be glad to provide any additional information and/or test any patches
susceptible to fix this problem.

TIA!

------- Additional Comment #5 From Vadim Zeitlin 2004-11-07 14:18 ------- 
Unfortunately updating to 2.6.9 didn't change anything for me. I'm currently
using the Debian (unstable) version with everything compiled as a module and if
I boot in single user mode and unload everything so that only intel_agp,
agpgart, ext3, jbd and mbcache (the 2 last ones used by ext3) are loaded, I
still have the same behaviour as before, i.e. after "echo mem >
/sys/power/state" the machine seems to enter standby (screen goes black, no 
more
network, keyboard leds don't work any longer) but the battery and AC led remain
permanently on, while normally the battery one should be off and the AC one
should be blinking slowly (i.e. this is what happens under Windows) and, most
importantly, nothing except hard reset can wake it up. Worse, after hard reset
the machine seems to start booting normally but nothing happens and I have to
reset it the second time to be able to reboot. I have no idea how to explain 
this...

As before, I'd be glad to provide any additional information, just please let 
me
know what can I do as so far I remain stuck.

Thanks!

Comment 7 Pierre Ossman 2004-11-09 05:58:54 UTC
I wouldn't say identical. The nw8000 has problems coming out of suspend. The
nx7010 isn't even able to enter suspend. No screen blanking, no led blinking,
nothing. It just stops dead.

From what I gather the x1000 is just the american name for the nx7010 so it's
strange if it gets further. Or perhaps it's just because Venkatesh's laptop is
newer/older.
Comment 8 Venkatesh Pallipadi 2004-11-09 07:06:17 UTC
Hmm. Not sure whether nw8000 has problems going into sleep or waking up from 
sleep.
One comment says it sleeps successfully and the other one says
"i.e. after "echo mem > /sys/power/state" the machine seems to enter standby 
(screen goes black, no more network, keyboard leds don't work any longer) but 
the battery and AC led remain permanently on, while normally the battery one 
should be off and the AC one should be blinking slowly (i.e. this is what 
happens under Windows) and, most importantly, nothing except hard reset can 
wake it up. Worse, after hard reset the machine seems to start booting 
normally but nothing happens and I have to reset it the second time to be able 
to reboot."

As the power LED doesn't actually blink, I think it must have failed to enter 
S3 properly. Just like on my X1000. 

I am trying to talk to some BIOS contacts in compaq about this bug. No luck 
yet. One more thing I noticed, if suspend with the sound driver loaded, there 
is a orange LED near the sound control buttons that starts glowing when I try 
to suspend.
Comment 9 Pierre Ossman 2004-11-09 10:43:01 UTC
The orange led is connected to the amplifier on the sound card. It is a rather
recent addition (at least here) that the sound driver turns it off before
suspending.

You can fiddle around with it by turning the amplifier on and of in the alsa
mixer (it has a separate channel).
Comment 10 Venkatesh Pallipadi 2004-12-16 09:48:30 UTC
Thanks to Shaohua, there is a patch that works for me on my Compaq Presario 
X1000. The patch can be found here - http://bugme.osdl.org/show_bug.cgi?id=3909

After applying the patch, system suspended cleanly and on resume there was no 
video, which is a known issue with radeon card and the workaround in bug #3670 
helped to get the video back.

Pierre/Vadim can you try this workaround and check whether it helps.
Thanks,
Comment 11 Len Brown 2004-12-16 18:21:32 UTC
*** Bug 3909 has been marked as a duplicate of this bug. ***
Comment 12 Shaohua 2004-12-16 20:57:20 UTC
Created attachment 4271 [details]
Not disable bus arbiter

This patch resolves the similar issue in compaq nx5000 laptop.
Test in Toshiba M2N and T40 doesn't show regression.
Comment 13 Scott James Remnant 2004-12-22 03:42:32 UTC
Sadly the second patch does not appear to fix #2664 - the similar, but obviously
subtly different HP compaq nc4010 still does not resume.
Comment 14 Len Brown 2004-12-23 20:55:19 UTC
patch in comment #12 applied to acpi-test tree 
 
Comment 15 Vadim Zeitlin 2004-12-25 19:23:17 UTC
Sorry for having taken so long to test this but my notebook has just returned
from repair... The first thing I did was to test this patch and it does work for
me: provided I unload USB modules first, the machine does wake up. There is the
video issue, as expected, and there is also this in the logs:

Dec 26 04:15:37 kernel: Back to C!
...
Dec 26 04:15:37 kernel:     ACPI-0286: *** Error: No installed handler for fixed
event [00000002]
Dec 26 04:15:37 kernel: Restarting tasks... done

I don't know (even after quick googling) whether this is important or not but
just wanted to mention it.


Anyhow, to summarize: the patch does fix the problem for HP nw8000, thanks a lot!
Comment 16 Shaohua 2004-12-26 17:06:10 UTC
>ACPI-0286: *** Error: No installed handler for fixed event [00000002]
Please follow up this issue in bug 3679
Comment 17 Michael Grigoriev 2004-12-28 14:30:35 UTC
*** Bug 3957 has been marked as a duplicate of this bug. ***
Comment 18 Craig Lamparter 2005-01-20 14:55:47 UTC
nw8000 here, SuSE 9.2 2.6.8-24-default, with the patch the system 
now enters suspend state (power led blinks).  However, after hitting 
the power switch the system does no resume.  wireless here, didn't 
attempt a ping, but there's no HD activity.  tried the && video_post 
also, no effect.  thanks a bunch for helping with this, I'm an HP 
employee, with access to the bios guys and executive management if 
it helps.. 
Comment 19 Venkatesh Pallipadi 2005-01-20 15:11:00 UTC
Hi Craig,

What video card do you have on this laptop. Radeon? lspci output will help.

can you try something like
echo 3 > /proc/acpi/sleep; shutdown
or 
echo 3 > /proc/acpi/sleep; dd if =/dev/hda of=/dev/null
So that you can get some indications of life after resume.

If only video is the issue then you can try the acpi_sleep options from 
Documentation/power/video.txt
Comment 20 Len Brown 2005-01-21 21:30:11 UTC
fix in comment #12 shipped in 2.6.11-rc1 
as it addresses the original issue, i'm closing this bug. 
 
Craig, you might want to open up a new bug for your system. 
Note that if the video doesn't POST and enable the back-light 
on resume from S3, we assert it is a platform BIOS bug -- 
you might bounce that off the BIOS team at HP. 
 
Comment 21 Michael Neuweiler 2006-03-14 08:16:14 UTC
had same problem with nc8000, kernel/acpi was not the cause - also not radeon
nor fglrx, see this link for info how to SOLVE the problem (at least on the hp
laptops) :

http://www.ubuntuforums.org/showthread.php?t=106564
Comment 22 Tommi Kyntola 2006-04-26 01:06:54 UTC
I'd just like to point out that the patch provided here (which is obviously in
mainline by now) does not work for my nw8000.

I've tried almost all 2.6 kernels up to 2.6.16.11 (vanilla and fc3/fc4/fc5) and
there's been no change on the behaviour.

Booting with init=/bin/sh, no modules (besides jdb and ext3) and 'echo mem >
/sys/power/state' still appears to suspend-to-ram properly (power led blinks)
and all that, but when hit power back on. It seems to start resuming, but
nothing happens. Caps-lock, wlan button, ping (if the eth0 was up earlier) nor
power button do anything. Only way to proceed from there is to remove batteries.

After hours of searching here I was unable to find a solution for nw8000.
Perhaps I should submit a new bug?
Comment 23 Tommi Kyntola 2006-04-26 02:25:33 UTC
Actually the resume does works on my nw8000 with the .config used to compile
fedora kernels for stock 2.6.16.11 _and_ I boot with init=/bin/sh. The screen
stays black after resume which was to be suspected by earlier comments, but the
hdd led gets turned off, caps-lock blinks and with eth0 up it returns ping.
However if I let it boot with bootparam single and I unload all the modules that
I can.

So it seems that there are some drivers I've compiled in in my configs (usb
being the most obvious choice here) that broke the resume earlier.

I'm now compiling numerous 2.6.16.11 with varied configs. I'll try to see what
it is exactly that triggers the resume failure between init=/bin/sh and single
boot possibilities. I'm not bothered about the screen being black as the sshd is
quite sufficient for now.
Comment 24 Tommi Kyntola 2006-04-26 08:22:57 UTC
Ok, I worked it out. It seems like it's the ich4 i2c_i801 driver to blame.

I prevously had it compiled in, which resulted in totally unfunctional s3
resume. Then when I tried a kernel where that was modularized the s3 resume
started working with init=/bin/sh, but didn't work with bootparam single (due to
rc.sysinit loading the i2c_i801).

It seemed to be the udev starting, which loaded the i2c_i801 and that was the
triggering factor. Even an rmmod for it would make the s3 resume work anymore.

There's some recent discussion going on in lkml about the i2c_i801:
http://lkml.org/lkml/2006/4/19/68
but that fix is not sufficient. So currently am unable to use the i2c_i801
alltogether if I wish to use suspend-to-ram.

As a note to other nw8000 users:
I'm now able suspend-to-ram on a nw8000 running fc5 from X using the default
radeon driver aswell as the fglrx (even glxgears stay functional after suspend
cycle) using suspend2 hibernate script (but in swsusp mode), provided that I use
a recent kernel which doesn't have i2c_i801. A relatively easy approach for that
is to rename the i2c_i801.ko into something else. Frankly, I'm not familiar with
i2c busses at all, so I have absolutely no idea what will break by doing so, but
alteast the suspend-to-ram starts to work. :)
Comment 25 Vadim Zeitlin 2006-05-18 14:28:03 UTC
FYI just wanted to report that nw8000 suspend (and also hibernate -- not
directly relevant but still nice) works out of the box with 2.6.15-22 kernel
used by Ubuntu 6.06 (Drapper). The only thing is that radeonfb module must not
be loaded when suspending as otherwise the machine doesn't resume, so the
console must be in 80*25 instead of much nicer 200*75 which radeonfb is capable
of -- but this is, of course, a small price to pay for the working suspend.
Comment 26 honkkis 2006-11-11 03:50:55 UTC
I am still having this problem with HP nx8220 with 2.6.18.2 kernel, but this
patch helps:

http://bugzilla.kernel.org/show_bug.cgi?id=2039