X21 double resume.

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
Noblunts
Posts: 24
Joined: Wed Apr 30, 2008 3:13 pm
Location: chicago, ILLINOIS
Contact:

X21 double resume.

#1 Post by Noblunts » Wed Jul 23, 2008 12:19 am

I got suspend and hibernate working on my x21 except for one issue. I have to resume twice. When I resume the first time the system goes into suspend right away. It resumes fine if I hit the button again.

GomJabbar
Moderator
Moderator
Posts: 9765
Joined: Tue Jun 07, 2005 6:57 am

#2 Post by GomJabbar » Wed Jul 23, 2008 12:39 am

I have the exact same problem on my T42. I spent some hours tonight troubleshooting it to no avail. I even switched from a laptop kernel to a desktop kernel, but that made no difference.

I had this working fine with Mandriva from a year ago. The same settings that worked in version 2007.1 don't work in 2008.1.

It has something to do with the button event Fn + F4. If I choose Suspend to RAM from the KPowerSave menu, it works fine.
DKB

GomJabbar
Moderator
Moderator
Posts: 9765
Joined: Tue Jun 07, 2005 6:57 am

#3 Post by GomJabbar » Sun Jul 27, 2008 1:41 am

I finally got this working in Mandriva 2008.1.

Steps taken:
1) Install suspend-s2ram - Suspend-to-RAM utility​
2) Uninstall kpowersave
3) Make sure you have ibm-acpi installed
4) Edit or create the following 4 files:

/etc/acpi/events/suspend

Code: Select all

event=ibm/hotkey HKEY 00000080 00001004
action=/etc/acpi/actions/suspend.sh
/etc/acpi/events/lm_lid

Code: Select all

event=button[ /]lid
action=/etc/acpi/actions/lm_lid.sh %e
/etc/acpi/actions/suspend.sh

Code: Select all

#!/bin/bash 
/usr/sbin/s2ram
/etc/acpi/actions/lm_lid.sh

Code: Select all

#!/bin/bash

test -f /usr/sbin/laptop_mode || exit 0

# lid button pressed/released event handler

/usr/sbin/s2ram

5) Make /etc/acpi/actions/suspend.sh executable.
6) Make /etc/acpi/actions/lm_lid.sh executable
7) Reboot (seems often needed for changes to become effective)

As far as I can tell, KPowerSave is incompatible with using the Hotkeys Fn + F4 for Suspend to RAM, although you can use the Suspend to RAM menu item in KPowerSave.

I am still working on Hibernate to Disk. I need to create or define the hibernation file, but I haven't yet come across the exact procedure to follow.

As a substitute for KPowerSave, I installed Klaptop for a power manager.

EDIT: Changed the lines above that read "/usr/bin/pm-has-power-policy || /usr/sbin/s2ram" to just "/usr/sbin/s2ram". On further reflection the first part of the command "/usr/bin/pm-has-power-policy ||" did not seem to apply to s2ram. Trying it both ways, I could not see that it made any difference during execution.

EDIT 2: I just discovered a webpage on s2ram that shows additional options if you run into trouble. You can also find out if your machine is on the whitelist. http://en.opensuse.org/S2ram
DKB

BigCatAndy
Sophomore Member
Posts: 129
Joined: Wed Feb 02, 2005 4:37 am
Location: Hamburg / Germany
Contact:

Re: X21 double resume. - same with T43p

#4 Post by BigCatAndy » Fri Mar 06, 2009 5:36 am

Hello everybody,
Noblunts wrote:I got suspend and hibernate working on my x21 except for one issue. I have to resume twice. When I resume the first time the system goes into suspend right away. It resumes fine if I hit the button again.
I have exactly the same issue with my T43p. My suspend-to-RAM/sleep functionality worked perfectly till January or so. Then I updated my Lenny (testing at that time), and noticed that strange behaviour with double resume.

Additional information: when I press Fn+F4 (suspend-to-RAM), the laptop goes to sleep. When I press Fn+F4 again, it "wakes up" and goes to sleep immediately again. And only when I press Fn+F4 again (3rd time), it starts to work.

I will try the hints, proposed by GomJabbar, and report about the results in a couple of days.

Cheers,
Andrey
IBM TP T60p 2008-9EG 2.33GHz / 3 GB / 100 GB, 15' UXGA 1600x1200, 320 GB in Ultrabay
Win7 Pro (32 bit) + Linux Mint 15

BigCatAndy
Sophomore Member
Posts: 129
Joined: Wed Feb 02, 2005 4:37 am
Location: Hamburg / Germany
Contact:

Double resume - resolution?

#5 Post by BigCatAndy » Tue Mar 10, 2009 4:34 pm

Hello everyone,

I think, I found the resolution of the "double resume" issue. If you have any custom scripts processing ACPI events (like lid of sleep), they are called together with "lm_*" scripts (which come from "laptop-mode" tool). So, the sequence - in my opinion - is as follows: [custom ACPI script] -> [lm_* script].

I wrote more in my blog - perhaps, someone could have a look at it. The address is here:http://myprivateblg.blogspot.com/2009/0 ... -wlan.html

Cheers,
Andrey
IBM TP T60p 2008-9EG 2.33GHz / 3 GB / 100 GB, 15' UXGA 1600x1200, 320 GB in Ultrabay
Win7 Pro (32 bit) + Linux Mint 15

BigCatAndy
Sophomore Member
Posts: 129
Joined: Wed Feb 02, 2005 4:37 am
Location: Hamburg / Germany
Contact:

Re: Double resume - resolution? - No!

#6 Post by BigCatAndy » Mon Mar 16, 2009 3:24 am

Hello again,
BigCatAndy wrote:Hello everyone,

I think, I found the resolution of the "double resume" issue. If you have any custom scripts processing ACPI events (like lid of sleep), they are called together with "lm_*" scripts (which come from "laptop-mode" tool). So, the sequence - in my opinion - is as follows: [custom ACPI script] -> [lm_* script].

I wrote more in my blog - perhaps, someone could have a look at it. The address is here:http://myprivateblg.blogspot.com/2009/0 ... -wlan.html

Cheers,
Andrey
I think, I celebrated a bit too early. :-( Today I usedmy laptop with a battery, and have encountered this issue with double resume again. :-( Any further hints would be nice...

Cheers,
Andrey.
IBM TP T60p 2008-9EG 2.33GHz / 3 GB / 100 GB, 15' UXGA 1600x1200, 320 GB in Ultrabay
Win7 Pro (32 bit) + Linux Mint 15

wap32
Freshman Member
Posts: 62
Joined: Wed Sep 10, 2008 7:51 am
Location: Porto, Portugal

Re: X21 double resume.

#7 Post by wap32 » Sun May 03, 2009 3:04 am

I've been having the same issue with my T61 on Fedora 10 lately, but its 3 times with me! :!:

The thing is, it only happens when I activate suspend or hibernate using the Fn+F4/F12 buttons, if I select suspend or hibernate via the graphical environment (on GNOME System>Shut Down>Suspend/Hibernate) everything works great. :|

This leads me to believe that, as it's already been said, it could be something with the ACPI scripts because hardware button events are passed to the ACPI daemon directly (or so I think).
T61 14.1" wide 7664-19G

BigCatAndy
Sophomore Member
Posts: 129
Joined: Wed Feb 02, 2005 4:37 am
Location: Hamburg / Germany
Contact:

Re: X21 double resume.

#8 Post by BigCatAndy » Wed May 06, 2009 3:37 pm

Hello@all,
wap32 wrote:I've been having the same issue with my T61 on Fedora 10 lately, but its 3 times with me! :!:

The thing is, it only happens when I activate suspend or hibernate using the Fn+F4/F12 buttons, if I select suspend or hibernate via the graphical environment (on GNOME System>Shut Down>Suspend/Hibernate) everything works great. :|

This leads me to believe that, as it's already been said, it could be something with the ACPI scripts because hardware button events are passed to the ACPI daemon directly (or so I think).
yes, the Power Manager of GNOME brought my laptop to the sleep mode without any issue. Hmm... Do you use any custom scripts to handle ACPI events? In my case I used earlier several scripts, which handled the ACPI events fired by FN+F4 keys. Now the ACPI handling of Linux became more mature, and all of a sudden I got several scripts. So, if you have/had custom scripts either, we could try to find the source of that "double/triple resume".

Cheers,
Andrey
IBM TP T60p 2008-9EG 2.33GHz / 3 GB / 100 GB, 15' UXGA 1600x1200, 320 GB in Ultrabay
Win7 Pro (32 bit) + Linux Mint 15

Post Reply

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 1 guest