Bug 115127

Summary: acpi: sleep-button does not work on IBM thinkpad; ibm_acpi redefines sleep button
Product: [openSUSE] SUSE LINUX 10.0 Reporter: m. bracher <mbra>
Component: Mobile DevicesAssignee: Timo Hoenig <thoenig>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: aj, behlert, dkukawka, liml, trenn
Version: Beta 4   
Target Milestone: ---   
Hardware: x86   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description m. bracher 2005-09-03 08:54:58 UTC
Hardware: Laptop IBM T40 - Type 2373-92G
Software: SuSE 10 Beta4, ACPI enabled

Using YaST power management module, ACPI settings...
Laptop Lid Closing: Suspend to RAM
  --> works
Sleep button: Suspend to RAM
  --> [Fn]+[F4] does not work, no action. 

[Fn]+[F4] works with Suse9.3 (and I think also with Beta3, but I cant't verify
that because I replaced it with beta4)

With APM instead of ACPI, [Fn]+[F4] works as expected.
Comment 1 Michael Gross 2005-09-03 19:46:45 UTC
Sounds very familiar. You should use APM then. The problem is that many BIOS's
are buggy. I won't dismiss this bug anyway, but please provide as much
information about your hardware as possible and provide us the last 1000 lines
of your syslog:

tail -1000 /var/log/messages > syslog.txt
Comment 2 Forgotten User ZhJd0F0L3x 2005-09-03 20:49:41 UTC
no. The T40 should be perfectly ACPI capable.
What you could try is:

boot, press F3 for extra bootoptions in grub menu, enter "init=/bin/bash"

in the shell you get, enter the following:

mount /proc # ("/" is on the "." key on a german keyboard)
modprobe button
cat /proc/acpi/event

check if the different ACPI buttons (lid switch, sleep, power) send events. If
this works, it is a userspace bug (powersaved, acpid,...). If not, retry it with
the boot option "ec_burst=0"
Comment 3 Markus Dellermann 2005-09-04 10:25:34 UTC
I have got the same problem with my T23 and SUSE 10.0 Beta4.
<Fn>-<F4> works with Suse9.3 and also with Beta2+3.

<Fn>-<F4> stopped working after I run an update from beta3 to beta4.

I followed your instruction to boot with init=/bin/bash

Not all of the <Fn> key combinations show up as an event (e.g. <Fn>-<F12> 
which should be suspend to disk does not show anything) but others (like <Fn>-
<F4> do) 

cat /proc/acpi/event
button/sleep SLPB 00000080 00000001
button/lid LID 00000080 00000001
button/lid LID 00000080 00000002

For me, too, the closing the lid will cause a suspend to disk (if configured 
that way). but <fn>-<F4> has no effect.
Comment 4 Forgotten User ZhJd0F0L3x 2005-09-04 11:40:36 UTC
Fn-F12 has no ACPI-function on any thinkpad i have seen, but fn-f4 not working
is strange. We need to look into this.
Can you check with Beta4 if you get an event in /var/log/acpid (running a
normally booted system, runlevel 3 or 5) if you press fn-f4? If this is the
case, we have a problem in the communication between acpid and powersaved or
powersaved is ignoring the sleep button for some strange reason. If not, acpid
has a problem.

Holger, Thomas, Danny: can you check if the sleep button works on _any_ machine?
My sony does not have an ACPI sleep button to check :-(
Comment 5 m. bracher 2005-09-04 12:02:44 UTC
uname -a
Linux ltmnb2 2.6.13-3-default #1 Mon Aug 29 19:48:23 UTC 2005 i686 i686 i386
GNU/Linux

"nothing" means: no output in /var/log/acpid and no functionality detected

[Fn]+[F1] nothing

[Fn]+[F2] nothing

[Fn]+[F3] 
With APM it turns off backlight, sound and turns off harddisk. with ACPI nothing
happens (Bug also exists on suse9.3)
[Sun Sep  4 13:45:08 2005] received event "ibm/hotkey HKEY 00000080 00001003"
[Sun Sep  4 13:45:08 2005] notifying client 5715[0:0]
[Sun Sep  4 13:45:08 2005] notifying client 5744[0:0]
[Sun Sep  4 13:45:08 2005] notifying client 13871[0:0]
[Sun Sep  4 13:45:08 2005] completed event "ibm/hotkey HKEY 00000080 00001003"

[Fn]+[F4]
Does nothing, the configured sleep state will not be activated.
[Sun Sep  4 13:47:01 2005] received event "ibm/hotkey HKEY 00000080 00001004"
[Sun Sep  4 13:47:01 2005] notifying client 5715[0:0]
[Sun Sep  4 13:47:01 2005] notifying client 5744[0:0]
[Sun Sep  4 13:47:01 2005] notifying client 13871[0:0]
[Sun Sep  4 13:47:01 2005] completed event "ibm/hotkey HKEY 00000080 00001004"

[Fn]+[F5]
enables bluetooth, Popup appears "New hardware found" (I don't know if it works
correctly, I have no bluetooth device). Messages in /var/log messages, but no
messages in /var/log/acpid

[Fn]+[F6] nothing

[Fn]+[F7]
Should enable external VGA. I have no external display available at the moment
to see if it happens something. No output in /var/log/acpid

[Fn]+[F8] nothing

[Fn]+[F9] nothing

[Fn]+[F10] nothing

[Fn]+[F11] nothing

[Fn]+[F12] 
[Sun Sep  4 13:53:04 2005] received event "ibm/hotkey HKEY 00000080 0000100c"
[Sun Sep  4 13:53:04 2005] notifying client 5715[0:0]
[Sun Sep  4 13:53:04 2005] notifying client 5744[0:0]
[Sun Sep  4 13:53:04 2005] notifying client 13871[0:0]
[Sun Sep  4 13:53:04 2005] completed event "ibm/hotkey HKEY 00000080 0000100c"

Comment 6 Forgotten User ZhJd0F0L3x 2005-09-04 12:14:34 UTC
ok. Got it. ibm-acpi is reconfiguring the sleep button. Bad.

the only thing you can do right now is either:
- create an hotkey script that triggers suspend (look in
/usr/share/doc/packages/powersave/contrib/acpi_hotkeys_* for examples)
- remove the ibm_acpi module, but this will cost you the ability to control the
display brightness via powersaved / software, hardware control should still work.

to prevent the ibm_acpi module from being loaded on next boot, you have to
remove it from /var/lib/acpi/laptop_modules.
Comment 7 Forgotten User ZhJd0F0L3x 2005-09-04 12:59:35 UTC
no blocker, but not nice.
Comment 8 Danny Al-Gaaf 2005-09-04 15:21:59 UTC
to #4: works for me with Acer Travelmate C300XMi as expected.
Comment 9 m. bracher 2005-09-04 20:18:09 UTC
I can confirm that disabling ibm-acpi activates the functionality of [Fn][F4] on
a IBM T40.
[Fn][F3] still has no function :-(

What ibm-acpi is good for? Display brightness works as usual: [Fn][Home/End]
works and when AC is unplugged, the brightness is decreased. (and in kpowersave
I have not found something to adjust the brightness)
Comment 10 Forgotten User ZhJd0F0L3x 2005-09-04 21:04:54 UTC
Fn-F3 is not supposed to do anything IIRC
ibm-acpi provides you with all those hotkeys - but with a different interface to
the sleep button :-( It also provides various functions for docking / undocking
and other Thinkpad specific stuff. If you don't know what it's good for, you
won't miss it :-)
Comment 11 m. bracher 2005-09-04 21:40:00 UTC
Thank you for the information. I have no docking station, so I won't miss
something ;-)

Fn-F3 is intended to turn off the display backlight (it works with APM)
http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-50023

On [F3] Key: a Display symbol and a "X" is printed on it
On [F4] Key: a Display symbol and a half-moon is printed on it
(see http://www.ixbt.com/portopc/ibm/t40/ea-keyboard2.jpg)
Comment 12 Thomas Renninger 2005-09-05 07:09:55 UTC
From comment #1 (suspend button does not work)
and comment #3 (suspend button does work with init=/bin/bash)
I expect that ibm_acpi module is disabling the sleep button?

If this is valid for all (or a lot of) Thinkpads we could treat this ACPI event:
[Sun Sep  4 13:47:01 2005] received event "ibm/hotkey HKEY 00000080 00001004"

simply as a button sleep event in the powersave daemon. This is an easy
workaround (in fact not even a workaround, but a fix).
Can someone confirm that this is always the sleep button on ibm_acpi machines?
Bad that this comes that late, I think the event should be the same on all
Thinkpads, but it seems to come from BIOS deeps and it cannot be said from the
ibm_acpi module...
Comment 13 m. bracher 2005-09-05 07:20:46 UTC
up to beta3 it worked as expected. 
Isn't it better to find out what has changed between beta3 and beta4 and if this
change is really necessary?
Comment 14 Forgotten User ZhJd0F0L3x 2005-09-05 07:34:10 UTC
we are loading ibm_acpi in beta4, we did not in beta3.

Thomas: this is no easy change in powersaved, since hotkey events are "other",
not "button", this logic would be quite bat.

But i found out, that ial handles the ibm_acpi events, so you can use ial to
assign "powersave -U" to them (and to all your other fancy IBM hotkey stuff).
Comment 15 Thomas Renninger 2005-09-05 16:46:24 UTC
It would be an easy change, we could simply filter out ibm/hotkey, check for the
1004 value and still let all others through as a an other event...

But you are right, this could conflict with the ial daemon...
Can this be enabled in the ial daemon by default?
Having another look at the module, I don't see why ibm_acpi overrides the sleep
button, seems to be an unexpected side effect.
So be aware that suspend could be invoked twice, but powersave daemon should be
able to handle this. If not we found a race condition bug :)

Timo/Seife: Will iald handle it?
Comment 16 Timo Hoenig 2005-09-06 08:54:45 UTC
iald is able to handle the hotkey events with prefix "ibm/hotkey". I think we should solve the issue by 
preventing ibm_acpi not to change the generic ACPI events. The events for buttons defined by the 
ACPI spec (Sleep Button, Power Button, Lid Switch) should _always_ be generated by button.c and 
thus have the generic "button/" prefix. The prefix "ibm/hotkey" is only fine for other ACPI events 
triggered on ThinkPads.
Comment 17 Thomas Renninger 2005-09-06 10:44:54 UTC
This is not easy...
It's probably not supposed by the ibm_acpi module to disable the sleep button.
Maybe the sleep button still works with ec_burst=0, can someone test that?
I don't see any relation between, the ibm_acpi module and the sleep button, so
this won't be fixable for 10.0.
Comment 18 Timo Hoenig 2005-09-06 13:45:45 UTC
Maybe those b.k.o bugs are related?

http://bugzilla.kernel.org/show_bug.cgi?id=5035
http://bugzilla.kernel.org/show_bug.cgi?id=4947#c5
Comment 19 Timo Hoenig 2005-09-07 11:10:38 UTC
The solution is almost done.
Comment 20 Timo Hoenig 2005-09-07 12:33:45 UTC
Will be fixed in RC2.

powersaved now recognizes the ACPI event "ibm/hotkey HKEY 00000080 00001004" as sleep button 
event.

Closing the bug. mbra, please verify.
Comment 21 m. bracher 2005-09-21 15:16:48 UTC
I'll verify it, but when is RC2 released? (there is no information in the Roadmap)
Comment 22 Andreas Jaeger 2005-09-26 08:04:51 UTC
it was only released internally - will be fixed in the final product.