Bug 3525 - Toshiba Sat Pro A10 fails to resume
Summary: Toshiba Sat Pro A10 fails to resume
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Sleep-Wake (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Venkatesh Pallipadi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-08 06:23 UTC by Herbert Xu
Modified: 2004-10-13 14:29 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.8.1 with ACPI 20040816
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg (168 bytes, text/html)
2004-10-08 06:24 UTC, Herbert Xu
Details

Description Herbert Xu 2004-10-08 06:23:01 UTC
Distribution: Ubuntu
Hardware Environment: Toshiba Sat Pro A10

This bug was reported to Ubuntu at

http://bugzilla.ubuntu.com/show_bug.cgi?id=1647

The problem is that when the laptop is suspended with "echo mem >
/sys/power/state" it fails to resume.  The resume almost works in the sense that
everything is brought back to life including X however the system immediately
enters a graceful shutdown as if a power-off event was generated.
Comment 1 Herbert Xu 2004-10-08 06:24:37 UTC
Created attachment 3785 [details]
dmesg
Comment 2 Herbert Xu 2004-10-08 06:25:47 UTC
Comment on attachment 3785 [details]
dmesg

><HTML><HEAD/>
><BODY>
><H1><A href="http://bugzilla.ubuntu.com/attachment.cgi?id=368">https://bugzilla.ubuntu.com/attachment.cgi?id=368</A></H1>
></BODY></HTML>
Comment 3 Venkatesh Pallipadi 2004-10-08 06:43:21 UTC
Do you have acpid running?
If yes, what does /etc/acpid/* contain?
Comment 4 Dan Alderman 2004-10-08 15:56:56 UTC
I certainly do have acpid running.

scutter:/home/dan# ps aux | grep acpid
root         5  0.0  0.0     0    0 ?        S<   23:41   0:00 [kacpid]
root      3511  0.0  0.1  1500  612 ?        Ss   23:41   0:00 /usr/sbin/acpid
-c /etc/acpi/events -s /var/run/acpid.socket

This is what I have in /etc/acpi

scutter:/home/dan# ls -R /etc/acpi/
/etc/acpi/:
events  lid.sh  powerbtn.sh  power.sh

/etc/acpi/events:
ac  battery  lidbtn  powerbtn

Dan.

Comment 5 Venkatesh Pallipadi 2004-10-08 22:03:45 UTC
Are you using power button to wake from S3.

If yes
Can you 
cat /etc/acpid/events/powerbtn

My guess is, it has a shutdown in there.
Comment that line (use #).

That should make resume work properly.
Comment 6 Dan Alderman 2004-10-09 02:29:46 UTC
I am using the power button to resume yes, I don't see how elses I can.  The
file in /etc/acpi/powerbtn.sh did have a shutdown command in it.  It now has the
following.

#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.

if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
then
    dcop --all-users ksmserver ksmserver logout 0 2 0 && exit 0
else
#    /sbin/shutdown -h now "Power button pressed"
fi

You were right, if I comment out the shutdown line it works as expected.  I am
using the command echo mem > /sys/power/state to go into suspend.  However, I
think I should point out that this only works if the usb modules uhci_hcd and
ehci_hcd are removed from the running kernel.  Otherwise it attempts to suspend
and then resumes immediately. Is this an error with the shell script then?

Also the wireless network doesn't resume correctly, it appears that I have lost
my route?

Thanks,

Dan.
Comment 7 Venkatesh Pallipadi 2004-10-09 08:46:37 UTC
It feels nice to see resume working isn't it :)

You can also use lid to suspend and resume.

Yes. The problem is with acpid and its configuration. But, with all the 
commenting, one side effect can be, you can no longer use power button to do a 
normal shutdown. :(

USB and wireless drivers are known issues. There should be other bugzillas 
talking about that. There is a experimental patch for wireless driver resume 
(by Zhu Yi at intel). You should be able to find it through googling.
 
Comment 8 Venkatesh Pallipadi 2004-10-11 09:50:48 UTC
Better workaround for this, rather than commenting out those lines in 
powerbtn.sh.

Before going to sleep, do "/etc/init.d/acpid stop" and after resuming, 
do "/etc/init.d/acpid start".
This way you will retain the functionality of the powerbtn, when you actually 
need it to shutdown the system.
Comment 9 David Leemans 2004-10-11 17:27:32 UTC
more intelligent solution : before suspending, touch a file somewhere, a
"we-are-now-in-suspend-marker" if you want. 
On resume, check for that file (in the powerbutton handler script): it it
exists, we are returning from suspend, if it doesn't exist, we are
"up-and-running" and wish to shutdown. 
That way, you can keep using the powerbutton for these 2 purposes. 
FWIW, the above algoritm is what I use on my (also) Toshiba Sat Pro laptop and
it works fine.

HTH,

David Leemans
Comment 10 David Leemans 2004-10-12 08:13:58 UTC
> On resume, check for that file (in the powerbutton handler script): it it
> exists, we are returning from suspend,

and then you delete the file of course

> if it doesn't exist, we are "up-and-running" and wish to shutdown. 
Comment 11 Venkatesh Pallipadi 2004-10-13 06:53:15 UTC
That is a better workaround. Now that the original S3 issue is resolved, and 
the issue is actually with acpid daemon and not the kernel, can I close this 
bug saying with CODE_FIX?
Any objections to this?
Comment 12 Herbert Xu 2004-10-13 14:28:07 UTC
That's fine by me.  Thanks.
Comment 13 Venkatesh Pallipadi 2004-10-13 14:29:53 UTC
This is a bug in acpid user daemon setup and not a bug in kernel.
And there are few workarounds for the acpid daemon bug. Closing this.

Note You need to log in before you can comment on or make changes to this bug.