Bug 670851

Summary: Power button does not power down machine on Lenovo T61
Product: [openSUSE] openSUSE 11.4 Reporter: Forgotten User 5jFyFBvk-I <forgotten_5jFyFBvk-I>
Component: KDE4 WorkspaceAssignee: E-mail List <kde-maintainers>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: afeher, alinm.elena, bwiedemann, ctrippe, forgotten_vXTZVacoSi, suse-beta, wstephenson
Version: Factory   
Target Milestone: ---   
Hardware: i686   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User 5jFyFBvk-I 2011-02-10 05:45:16 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b10) Gecko/20110121 Firefox/4.0b10

Pressing power button does not shutdown.
Tailing /var/log/messages reports nothing
Closing lid makes machine sleep perfectly. Init 0 works, selecting Leave->Shutdown in KDE works fine

I have made no alterations to the default installation of the factory installation. No changes to power management etc

Reproducible: Always

Steps to Reproduce:
1.Start machine
2.Log into KDE
3.Press power button
Actual Results:  
Nothing happens

Expected Results:  
Machine should power down
Comment 1 Forgotten User vXTZVacoSi 2011-02-11 08:25:43 UTC
Testing on my T400 with xev there is no keypress, udevadm registers no acpi event, nor does acpi_listen, KDE has nothing to act upon here, reassigning to kernel.
Comment 2 Forgotten User vXTZVacoSi 2011-02-11 08:29:38 UTC
Sorry reassigned to fast.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/564051

You need to hold it for more then a second, then I get an event with acpi_listen and also XF86PowerOff in xev, this is a kde problem
Comment 3 Forgotten User 5jFyFBvk-I 2011-02-11 08:36:33 UTC
Pressing and holding for 1 sec+ results in: button/power PWRF 00000080 00000007 with acpi_listen
and with xev something like this:
MappingNotify event, serial 35, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyPress event, serial 35, synthetic NO, window 0x5c00001,
    root 0xad, subw 0x0, time 11025477, (49,116), root:(1067,138),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False
Comment 4 Forgotten User vXTZVacoSi 2011-02-11 23:34:27 UTC
Needs backport of
http://quickgit.kde.org/?p=kde-workspace.git&a=commitdiff_plain&h=639092d4356296b8ab90aec264665ca599c6a894

and removing your /.kde4/share/konfig/powerdevil2profilesrc (recommendable after the fix anyways, the current values are totally bogus)

Bille will there be a branch update? Or should I just package up this single patch and apply to kdebase4-workspace?

The other 2 fixes seem useful bugfixes as well
http://websvn.kde.org/branches/KDE/4.6/kdebase/workspace/powerdevil/?view=log
Comment 5 Christian Boltz 2011-02-12 00:09:57 UTC
Besides the bug in KDE (see comment #4), I'd say it's a bug that you need to hold the power button for 1 second. 
That's probably kernel related and only happens on some hardware. (And it's not nice - if you hold the power button too long (5 seconds), most laptops are switched off the hard way.)
Please open a separate bugreport against the kernel for this part.
Comment 6 Forgotten User vXTZVacoSi 2011-02-12 00:25:04 UTC
I mailed thinkpad-linux if this is a hardware/embedded controller limitation or thinkpad-acpi, let's see what they say, the maintainer is often pretty responsive on that list.
Comment 7 Will Stephenson 2011-02-12 12:44:24 UTC
Please apply this patch and the other two if you have time.
Comment 8 Forgotten User vXTZVacoSi 2011-02-15 00:27:49 UTC
sr61213

I forgot kdebase switched to git already so there are more patches to powerdevil, most point at a bko report they fix so I think we should get all the patches.

How about the .desktop translations though, I just included them to get it done faster, are string updates a problem?
Comment 9 Will Stephenson 2011-02-18 20:47:05 UTC
Better to have the bug fixed.
Comment 10 Forgotten User vXTZVacoSi 2011-02-18 21:41:47 UTC
The patch for the PowerButton is in the powerdevil fixes you submitted to Factory, you need to delete your ~/.kde4/share/config/powerdevilprofiles2rc though
Better delete the other powerdevil ones too ;-)
Comment 11 Forgotten User vXTZVacoSi 2011-02-18 21:43:13 UTC
Oh and for the delay this is the reply from Henrique

On Sat, 12 Feb 2011, Karsten König wrote:
> to get the acpi powerbutton event one needs to press the button for more then 
> a second, is this a thinkpad-acpi limit or a limit by the embedded controller?

It is standard to have to hold that button for a while, usually 3s, before
it will signal anything to the operating system.

Some BIOSes let you choose between delayed or instant-off, and what kind of
signal (shutdown or "sleep") the button should issue.

> If it is the former could this maybe be adjusted? I thought it was an acpi 
> problem that I got no shutdown when pressing it.

Look in the BIOS.  I don't recall if the thinkpad lets you change it.

And this is standard, generic ACPI functionality, controled by the acpi
"button" driver.
Comment 12 Forgotten User vXTZVacoSi 2011-02-21 07:57:34 UTC
*** Bug 673682 has been marked as a duplicate of this bug. ***
Comment 13 Bernhard Wiedemann 2011-02-21 09:43:34 UTC
If this is really a dup of bug 673682, then it is not hardware-related at all.

btw:
All BIOSes I saw only needed a tap to send a powerdown event to the OS.
The holding of a power-button is only for power-off which has nothing to do with the operating system.
Comment 14 Forgotten User vXTZVacoSi 2011-02-21 10:09:09 UTC
Powerdevil saw some last minute changes where the default profiles were botched up so there was no registered action for XF86Shutdown keycode, this is fixed by backporting powerdevil changes from 4.6 branch.

The response about the delay I got from the maintainer of thinkpad-acpi and my Thinkpad does send the keycode (after delay) as does qemu-kvm, so this is fixed for the KDE side.

I asked Henrique for further information about that delay and where it comes from and will provide it here or just check thinkpad-linux list, if you then think this is a bug please open a new one.
Comment 15 Forgotten User vXTZVacoSi 2011-02-22 07:30:02 UTC
His reply is in:

On Mon, 21 Feb 2011, Karsten König wrote:
> So there is no code in thinkpad-acpi that encodes how long one has to press 
> the button?

No. There isn't such code *anywhere*.  It lives in the BIOS or the EC (could
be in the ACPI DSDT, though).

_______________________________

So the hardware vendor decided upon this and we can't do anything about it.
Comment 16 Andras FEHER 2011-02-23 10:01:19 UTC
On Lenovo G550 the same problem on KDE desktop, but working fine on Gnome desktop.
Comment 17 Alin M Elena 2012-11-16 01:02:40 UTC
no activity for more than 1y and 11.4 is dead... please create a new bug if still present in current version 12.2

Alin
Comment 18 Christian Trippe 2012-11-16 20:45:53 UTC
.