/proc/acpi/button/lid/*/state always says "open"

Bug #89860 reported by Christian Convey
282
This bug affects 68 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Won't Fix
Medium
Unassigned
linux-source-2.6.20 (Ubuntu)
Won't Fix
Medium
Unassigned
linux-source-2.6.22 (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

My laptop is an HP Pavilion dv4000. I'm running up-to-date Feisty.

Regardless of whether my laptop lid is open or closed, I always get this:

root@peace:/etc/acpi# cat /proc/acpi/button/lid/*/state
state: open

This would explain why I can suspend the laptop using Gnome's power management menu, but why it doesn't do it when I close the lid. (I have specified under power management preferences that it's to suspend when I close the lid.)

I know that at some level the lid switch works because when I press it the screen backlight turns off (although I can still faintly see that the display is still live).

There was one hint of the issue in this email:
   http://lists.opensuse.org/opensuse-mobile/2007-02/msg00016.html

Here's a Ubuntu bug that seems similar, but got rejected:
   https://launchpad.net/ubuntu/+source/kernel-package/+bug/16662

My bug is different than this one:
   https://launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/34389
because my laptop state is *always* reported as open.

I've attached the output of dmesg and dmidecode.

Tags: cft-2.6.27
Revision history for this message
Christian Convey (christian-convey) wrote :
Revision history for this message
Christian Convey (christian-convey) wrote :
description: updated
Revision history for this message
Christian Convey (christian-convey) wrote :

FYI, I also ran "tail -f /var/log/acpid".

When I do something like unplug the power adapter, I see plenty of output. But when I close or open the laptop lid, I don't see any new output.

Revision history for this message
Christian Convey (christian-convey) wrote :

Also, in terms of software versions:

"uname -a": Linux peace 2.6.20-9-generic #2 SMP Mon Feb 26 03:01:44 UTC 2007 i686 GNU/Linux

"dpkg -l hal": 0.5.8.1-4ubuntu8

"dpkg -l acpid": 1.0.4-5ubuntu5

"dpkg -l gnome-power-manager": 2.17.92-0ubuntu1

Revision history for this message
Christian Convey (christian-convey) wrote :

Note that this present bug is possibly the root cause of the following bug:
https://bugs.launchpad.net/ubuntu/+source/acpid/+bug/48471

Revision history for this message
Christian Convey (christian-convey) wrote :

I updated the laptop's BIOS to HP's latest, "F.17" and the bug is still manifest.

Revision history for this message
Christian Convey (christian-convey) wrote :

But is still present in the updated kernel, version
"2.6.20-11-generic #2 SMP Thu Mar 15 08:03:07 UTC 2007 i686 GNU/Linux"

Revision history for this message
Ben Collins (ben-collins) wrote :

I'd still say this is a BIOS bug. Does the laptop lid work under Windows?

Changed in linux-source-2.6.20:
assignee: nobody → ben-collins
status: Unconfirmed → Needs Info
Revision history for this message
Christian Convey (christian-convey) wrote : Re: [Bug 89860] Re: /proc/acpi/button/lid/*/state always says "open"

I just tried it just now in Windows, and everything works correctly.

Windows does the right thing when the lid is closed. The screen fully
blanks (rather than just shutting off the back-light) and the laptop
sleeps, which is the action I specified in Control Panel -> Power
Options.

On 3/20/07, Ben Collins <email address hidden> wrote:
> I'd still say this is a BIOS bug. Does the laptop lid work under
> Windows?
>
> ** Changed in: linux-source-2.6.20 (Ubuntu)
> Assignee: (unassigned) => Ben Collins
> Status: Unconfirmed => Needs Info
>
> --
> /proc/acpi/button/lid/*/state always says "open"
> https://launchpad.net/bugs/89860
>

Changed in linux-source-2.6.20:
assignee: ben-collins → ubuntu-kernel-acpi
importance: Undecided → Medium
status: Needs Info → Confirmed
Revision history for this message
Christian Convey (christian-convey) wrote :

Fixed!!!

It seems to be fixed with one of today's updates, because I re-confirmed the bug a day or two after updating.

My kernel:
Linux peace 2.6.20-14-lowlatency #2 SMP PREEMPT Mon Apr 2 20:41:03 UTC 2007 i686 GNU/Linux

Actually, I don't think the kernel updated, so perhaps this fix came from some chance outside the kernel itself?

Revision history for this message
Christian Convey (christian-convey) wrote :

NOT FIXED!!!

*&^(*&^*% I don't know why, but it's back to the original, bad behavior. I've tried various suspends / hibernates / cold reboots, and I still can't get the /proc/acpi/.../state value to be "CLOSED" when the lid button is down. :(

Revision history for this message
Jeff Trull (jetrull) wrote :

This problem appears to be the root cause of my laptop's failure to hibernate on lid close. The settings appear right, and I can see that /etc/acpi/lid.sh is getting run. Adding debug echos to that script shows that /proc/acpi/button/lid/LID/state always gives "state: open".

As with Christian's case, I can successfully hibernate from menus, etc. - just not from lid close. This worked fine on Dapper for me, so seems to be some type of regression.

dmidecode output attached.

Regards,
Jeff Trull

Changed in linux-source-2.6.20:
status: Confirmed → Triaged
Changed in linux-source-2.6.22:
assignee: nobody → ubuntu-kernel-acpi
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Christian Convey (christian-convey) wrote :

Fixed in 2.6.22-12-generic (pre-release Gutsy).

Resume-from-suspend still has some issues, like the network interfaces disappear. But the regardless, /proc/acpi/button/lid/LID/state is definitely accurate now.

Revision history for this message
Claudio (cwr) wrote :

Still doesn't work on my HP compaq nx5000 and nc6000. Running gutsy and it's 2.6.22-14-generic kernel. Even backlight isn't turned of when closing the lid (or pressing the lid-switch).

Revision history for this message
CurtBinder (curt-binder) wrote :

Apparently this sounds like it could be the cause of my HP Compaq nc6320 not suspending on lid close either. I posted a comment about this under https://bugs.launchpad.net/bugs/155502

I probably should have posted here instead.

Revision history for this message
Vadim Zeitlin (vz-ubuntu) wrote :

I'm not sure if it's exactly the same bug but the symptoms look similar: under Gutsy, my HP nw8000 never reports lid as being closed in /proc/acpi/button/lid/C138/state and acpid doesn't generate any events when the lid is closed, although it does generate from one up to a dozen of them (!) when it is opened.

Notice that this used to work just fine under Dapper and Feisty so this is definitely a regression. I'd be happy to provide any addition information which may be needed to narrow this down, for now I attach dmidecode output.

Revision history for this message
Filippo Pagin (feryllt) wrote : This bug interests also notebook HP NX6110

This bug interests also notebook HP NX6110 (linux certified: http://developer.novell.com/yes/80551.htm) on both ubuntu 7.10 and kubuntu 7.10 (although in different ways).

When I close the lid the screen is correctly turned off. Neverthless when the lid is reopened the system ignores this fact and continue to act as if the lid were still closed.
In kubuntu the screen is turned on for few seconds and then turn off again. The movement of the mouse cause a lighting followed by a sudden turning off.
In ubuntu the screen turn on correctly but programs, like "gnometris", randomly enter in paused mode.
The problem never come with earlier versions. And is really annoying in kubuntu.
(Besides it seems that the system also has problems to enter automatic suspension.)

Refer to:
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/159309

Revision history for this message
thistleep (ethan1) wrote :

Bug also in effect on HP NC6000. I have three of these notebooks. Two running Gutsy... lid state never changes therefore display doesn't shut off upon closing the lid. The other is running Feisty... lid state changes and display shuts off. Open the lid and display turns on and password prompt appears.

Works in Feisty, busted in Gutsy. Hope this is fixed soon. I like Gutsy a little better than Feisty but cannot live with this bug.

Revision history for this message
Fred van Zwieten (kubuntu-dezwietjes) wrote :

Same on HP nx7400 laptop. I'm running the latest BIOS version and it's still there. I've been running openSUSE 10.3 on this machine and it doesn't have this problem, but it did have other sorts of problems in this area, which they fixed with a kernel patch. See https://bugzilla.novell.com/show_bug.cgi?id=326814

Revision history for this message
thistleep (ethan1) wrote :

Interesting additional detail...

If I hibernate the laptop (HP NC6000), then "wake" it back up the lid switch status now works as expected. Push the lid button and the status becomes closed and the display turns off. Release the lid button and the status becomes open and the display turns back on again. (I have my lid close action set to display off rather than suspend)

Still not ideal but since my laptop is almost always left on, until a real fix is supplied I can use this work around. Sure wish it would be fixed tho....

Does this work around spark any ideas as to the cause of the problem or better yet a solution???

-e

Revision history for this message
massond (davidmasson93) wrote :

I have the same problem, but it won't properly shutdowr as well.

Revision history for this message
Fred van Zwieten (fvzwieten) wrote :

I did a upgrade to Hardy Alpha 2 (amd64) no deal. Problem is stil there.

Revision history for this message
Fred van Zwieten (fvzwieten) wrote :

I did an install of both ubuntu and kubuntu Gutsy on i386. No deal. Bug is still there.

Revision history for this message
david.barbion (david-barbion) wrote :

I have the same problem on a HP NC6000, the state is updated *only* when the sleep button (FN+F3 is pressed and the computer awaken again).
The lid button doesn't affect the state when the computer is on...
Bios 68BDD Ver. F.14

Revision history for this message
Jiao Wenmin (hsinjwu) wrote :

Same problem with my HP 520 laptop, version 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57 UTC 2007 i686 GNU/Linux
lid state always open.

Revision history for this message
Jiao Wenmin (hsinjwu) wrote :

Lid state reports correctly after hibernate-resume(???)
fine in Winxp

Revision history for this message
SUN Gui Lin (guilin-sun) wrote :

I have same problem on my HP 520 laptop.

Revision history for this message
kovaje (kovaje) wrote :

HP Compaq nx6310: same problem.

Revision history for this message
kovaje (kovaje) wrote :

Under WinXP it has been working fine.
uname -r => 2.6.22-14-generic
Ubuntu Gusty Gibbon 7.10

Revision history for this message
drittponken (tosu-michel) wrote :

Doesn't work for me either.

HP compaq nc6000
Ubuntu Gutsy gibbon

Revision history for this message
drittponken (tosu-michel) wrote :

Additional info.

As thistleep said before;

He said that if he hibernated his nc6000 and then woke it the lid button works.
That is the case for me too. If works perfectly.

Revision history for this message
Mika Fischer (zoop) wrote :

I can confirm this behavior on my Samsung Q45 (https://wiki.ubuntu.com/LaptopTestingTeam/SamsungQ45Dalia).

After boot closing the lid does nothing. After one Suspend-to-RAM and resume cycle, closing the lid works as expected.

I'll attach the dmesg after boot and after the STR-resume cycle...

Revision history for this message
Mika Fischer (zoop) wrote :
Revision history for this message
Mika Fischer (zoop) wrote :

I forgot to say: I'm running hardy.

Let me know if I can do something to help debugging this problem.

Revision history for this message
kovaje (kovaje) wrote :

HP Compaq nx6310
Ubuntu Hardy Heron 8.04

Lid button still does not work.

Changed in linux-source-2.6.24:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Philipp Kohlbecher (xt28) wrote :

I am experiencing the same issue under hardy on a Samsung X20 XVM 1730 V laptop. The lid button state is always reported as "closed", though.

For me, this used to work up until gutsy, I think. It is definitely a regression.

Revision history for this message
Arthur Archnix (arthur-archnix) wrote :

I see that the bug has been triaged. I also suffer from the bug. I'm running an up-to-date Gutsy install (uname -r = 2.6.22-14-generic).

cat /proc/acpi/button/lid/C20C/state always returns "open". Closing lid to standby works in vista, so it's not hardware failure.

Unfortunately, dmesg doesn't give any clues. I run dmesg, then close the lid, then open, and nothing new has appeared.

If I can provide more information or run some test please let me know.

Revision history for this message
Kostiantyn Kucher (kk222bt) wrote :

I have HP 530 and Kubuntu, and lid doesn't work. I have tried Ubuntu 8.04 as live CD and it works there perfectly, also it does work from Kubuntu 8.04 live CD, BUT after a couple of seconds the display turns on.

1 comments hidden view all 113 comments
Revision history for this message
drittponken (tosu-michel) wrote :

It dos work for me now.
I'm running Xubuntu 8.04 Hardy Heron but with the gnome desktop so i guess we can say Ubuntu.

Well i have the HP Compaq nc6000 and the lid works perfekt now :)

Changed in linux-source-2.6.20:
status: Triaged → Won't Fix
Changed in linux-source-2.6.22:
status: Triaged → Won't Fix
DeeKey (privateinf)
Changed in acpi:
status: New → Confirmed
Wes Garner (wesgarner)
affects: linux-meta (Ubuntu) → ubuntu
Changed in linux (Ubuntu):
assignee: nobody → Ubuntu Kernel ACPI Team (ubuntu-kernel-acpi)
status: Triaged → New
Changed in acpi:
status: Unknown → Confirmed
Changed in acpi:
status: Confirmed → Incomplete
Wes Garner (wesgarner)
Changed in acpi (Ubuntu):
assignee: nobody → Ubuntu Kernel ACPI Team (ubuntu-kernel-acpi)
affects: ubuntu → acpi-support (Ubuntu)
33 comments hidden view all 113 comments
Revision history for this message
Steve Langasek (vorlon) wrote :

'acpi' is a package that provides an interface emulating an older 'apm' command; please don't assign generic ACPI bugs here.

Changed in acpi (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Steve Langasek (vorlon) wrote :

acpi-support is also unrelated to the contents of anything under /proc/acpi.

Changed in acpi-support (Ubuntu):
status: New → Invalid
Changed in linux (Ubuntu):
status: New → Triaged
Revision history for this message
Philipp Kohlbecher (xt28) wrote :

Here is what happens with a 2.6.30 kernel from kernel.org:

After booting the system, he lid button state is reported as "closed".
After closing the lid for several seconds and opening it again, it is correctly reported as "open".
From that point on, the state is correctly reported, but with a rather long delay (c. 10 seconds).

This behavior probably hasn't changed since 2.6.26 or so.

Changed in acpi:
status: Incomplete → Invalid
Revision history for this message
Jānis Kangarooo (kangarooo) wrote :

https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/89860/comments/55
This comment reminded me at my bug comment in Bug keyboard freezes on boot--sometimes https://bugs.launchpad.net/ubuntu/+source/linux/+bug/190834/comments/13
i could get keyboard working only when pressing to ON right before Ubuntu logo appears and Loading begins
Maybe dublicate source of the problem?

Revision history for this message
Mark (mark-ale8) wrote :

I have a HP NC4400 laptop and I'm experiencing the same problem on Karmic Koala (kernel 2.6.31-3-generic). After a cold boot /proc/acpi/button/lid/C241/state always shows "open" no matter if the lid switch is activated. When the lid switch is activated the LCD backlight does turn off but does not trigger the change of ACPI state. Manual sleep from KDE power manager works as expected.

Strangely the workaround posted above corrects my problem. After a cold boot, doing a hibernate manually from KDE power manager and then waking the machine causes the lid switch to start to work correctly.

Revision history for this message
hq4ever (hq4ever) wrote :

HP 530 same issue.

uname -a
Linux lucky 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686 GNU/Linux

$ ps -ef | grep acpi
root 18 2 0 19:21 ? 00:00:00 [kacpid]
root 19 2 0 19:21 ? 00:00:00 [kacpi_notify]
root 2213 1 0 19:22 ? 00:00:00 /usr/sbin/acpid -c /etc/acpi/events -s /var/run/acpid.socket
111 2543 2469 0 19:22 ? 00:00:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
hq4ever 6452 6235 0 21:52 pts/0 00:00:00 grep acpi

Revision history for this message
hvh (hvhouten) wrote :

HP compaq NC6320. Same problem.

Also, after 'suspend to disk', the lid state is reported correctly (lshal -m and /proc/acpi/button/lid/*/state and laptop suspends as expected.

uname -a
Linux Pampus 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686 GNU/Linux

Revision history for this message
Mark (mark-ale8) wrote :

I recently upgraded to karmic 64bit from 32bit and the problem vanished. Using the stock 64bit kernel the lid switch is working properly, yet did not work in 32bit.

Revision history for this message
DeeKey (privateinf) wrote :

Upgraded to karmic 32bit. Does not work on HP Compaq nc600

Revision history for this message
DeeKey (privateinf) wrote :

As others noted before after Hibernate the lid started to work.
Unfortunately it is working till first reboot or poweroff.

Revision history for this message
AlexW (alex.wedensky) wrote :

HP Pavilion dv4000 -- confirming the issue on both Jaunty and Karmic.

Also, under Karmic:

suspend-->close the lid-->open the lid: laptop wakes up only to go to suspend immediately. Judging by the time stamps from the logs, the suspend sequence continues after waking up. The cycle breaks if wake up is done by pushing the power button. (this is new in Karmic for this machine)

disconnecting the AC sends the laptop into suspend (same in Jaunty and in Karmic).

trying to boot with acpi=off doesn't really fix the issue, but breaks KMS and screen compositing!

guys, please keep working on the solution.

Revision history for this message
Jānis Kangarooo (kangarooo) wrote :

lshal -m
and pushing lid button generates 2x times closing and opening.
Start monitoring devicelist:
-------------------------------------------------
12:12:37.511: computer_logicaldev_input_2 property button.state.value = true
12:12:37.527: computer_logicaldev_input_2 condition ButtonPressed = lid
12:12:44.040: computer_logicaldev_input_2 property button.state.value = false
12:12:44.056: computer_logicaldev_input_2 condition ButtonPressed = lid
12:12:51.135: computer_power_supply_battery_BAT0 property battery.voltage.current = 16335 (0x3fcf)

Revision history for this message
DeeKey (privateinf) wrote :

Upgraded to lucid (10.04) -- does not work.

Computer: HP compaq NC6000

Revision history for this message
Radoslav Kolev (radoslav) wrote :

Same problem on Lucid 10.04 on an HP nc6120.

Revision history for this message
MNLipp (mnl) wrote :

Same problem with lucid and nc6000.

lshal -m
and pushing lid button does not produce any output at all (and it is not a hardware failure, checked with Windows).

Revision history for this message
MNLipp (mnl) wrote :

Tried lucid with latest 2.6.34 kernel from mainline and the lid button worked again! Couldn't resume from hibernate though. Upgraded to mevarick beta and lid button stopped working again, sigh...

Revision history for this message
MNLipp (mnl) wrote :

Being at it, I tried maverick beta with mainline kernel linux-image-2.6.36-999-generic_2.6.36-999.201009240945_i386.deb. This works again (nc6000)! So there's still hope...

Revision history for this message
Péter (pepe-ezkell) wrote :

+1 acer travelmate 5520g Linux 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010 x86_64 GNU/Linux

cat /proc/acpi/button/lid/LID0/state always says open

Revision history for this message
Mikele (mikilion) wrote :

Same problem with Lucid 10.04.1 on HP 530 laptop.
Linux 2.6.32-27-generic #49-Ubuntu SMP Thu Dec 2 00:51:09 UTC 2010 x86_64 GNU/Linux

"cat /proc/acpi/button/lid/C20C/state" always says open

Changed in acpi:
status: Invalid → Expired
Changed in acpi:
importance: Unknown → Medium
Revision history for this message
Mikele (mikilion) wrote :

I noticed that after it resuming from hibernate the lid button works; if I reboot system the lid button stop working again.

Revision history for this message
Mikele (mikilion) wrote :

I found this workaround:
https://bugzilla.redhat.com/show_bug.cgi?id=512958#c23

sudo su
echo 1 > /proc/acpi/video/C085/DOS
echo 0 > /proc/acpi/video/C085/DOS

Revision history for this message
DeeKey (privateinf) wrote :

Works for my HP compaq nc6000
Though my command is slightly different:
echo 1 > /proc/acpi/video/C0CF/DOS
echo 0 > /proc/acpi/video/C0CF/DOS

My current system is:
Ubuntu 10.04.2 LTS
2.6.32-28-generic

According to the thread mentioned in previous post the problem could be caused by the patch
"linux-2.6-acpi-video-dos.patch". Not sure if it is present in ubuntu patches.

-----------------------------------------------------
Alexei Panov 2010-03-04 17:42:54 EST

I have found a patch which breaks operation of Lid Switch on HP Mini 5101, and
possible on others HPs.
This patch is linux-2.6-acpi-video-dos.patch. If you build a kernel without
this patch lid switch perfectly works.
I suggest to test for those who have such problem, I have made a variant of a
kernel without the offending patch ftp://ftp.atisserv.ru/kernel-hp-lid/
-----------------------------------------------------

Revision history for this message
david.barbion (david-barbion) wrote :

Those 2 commands work for me too on my HP NC6000 (ubuntu 10.10)

Revision history for this message
João Gomes (jvpgomes) wrote :

My problem is a little different. I don't know if it is related.

The state in /proc/acpi/button/lid/LID/state is ALWAYS correct.

However, after I close the lid for the first time and open it again, the gnome-power-manager always says:
"lid is closed, so we are ignoring ->NORMAL state changes"
(but the lid is open)

If I reboot or hibernate, everything goes back to the normal. It's only when I close the lid and open it again that this problem appears.

Revision history for this message
Giuseppe Stolnicu (giuseppe-stolnicu) wrote :

Bug still present in 11.04 . HP 530 notebook. The only thing that does not seem to work is the lid.

cat /proc/acpi/button/lid/C20C/state
state: open

State is always open, even when I press the little button that should turn off screen (on my HP the screen margins press on a little button above the keyboard when you close the lid) .

In Win 7 it works perfectly, so it's not a hardware problem.

I do not have any "/proc/acpi/video", so I can' test the above stuff.

I have a Intel 945gm express integrated video card - using the i915 video driver.

Can somebody change the status of this bug?

Revision history for this message
andrzej (a1-andrzej) wrote :

i confirm that bug still occurs in ubutu 11.04.
There is no /proc/acpi/video/*/DOS, it was there in beta version of 11.04 and "echo 1 >>..." workaround was working like charm.
Now we stuck with no solution...Please help. Maybe other kernel? anything - this is very irritating bug

Revision history for this message
BSA (b-s-a) wrote :

Confirm. I have same problem with Gigabyte N601. But LID status is always "closed".
Ubuntu 11.04, x86

Revision history for this message
Brad Figg (brad-figg) wrote : Unsupported series, setting status to "Won't Fix".

This bug was filed against a series that is no longer supported and so is being marked as Won't Fix. If this issue still exists in a supported series, please file a new bug.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: Triaged → Won't Fix
Revision history for this message
aysiu (ubuntubugzilla-psychocats) wrote :

This problem still occurs in Ubuntu 11.04. What is the "series" that's not supported? The kernel version? I'm talking about 11.04 with the latest kernel--the problem still exists.

Revision history for this message
BSA (b-s-a) wrote :
Revision history for this message
adampaetznick (adampaetznick) wrote :

Same problem on Samsung Series 9 NP9003XB running 12.04 (beta 2)

Revision history for this message
Terry Hu (hubin-82) wrote :

Hi, I met the same problem. I am on 11.10, upgraded from 11.04. When I close the lid, nothing happened. It affects me very much. Could you please provide the fix? Thanks!

no longer affects: acpi (Ubuntu)
no longer affects: acpi-support (Ubuntu)
Changed in linux-source-2.6.20 (Ubuntu):
assignee: Registry Administrators (registry) → nobody
Changed in linux-source-2.6.22 (Ubuntu):
assignee: Registry Administrators (registry) → nobody
Changed in linux (Ubuntu):
assignee: Registry Administrators (registry) → nobody
no longer affects: acpi
Revision history for this message
Wes Garner (wesgarner) wrote : Re: [Bug 89860] Re: /proc/acpi/button/lid/*/state always says "open"

Unsubscribe

--
Wes Garner
<email address hidden>
Mobile: 205-202-0021
Fax: 205-995-8790
On Apr 2, 2012 11:55 PM, "Robert Collins" <email address hidden> wrote:

> ** No longer affects: acpi (Ubuntu)
>
> ** No longer affects: acpi-support (Ubuntu)
>
> ** Changed in: linux-source-2.6.20 (Ubuntu)
> Assignee: Registry Administrators (registry) => (unassigned)
>
> ** Changed in: linux-source-2.6.22 (Ubuntu)
> Assignee: Registry Administrators (registry) => (unassigned)
>
> ** Changed in: linux (Ubuntu)
> Assignee: Registry Administrators (registry) => (unassigned)
>
> ** No longer affects: acpi
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/89860
>
> Title:
> /proc/acpi/button/lid/*/state always says "open"
>
> Status in “linux” package in Ubuntu:
> Won't Fix
> Status in “linux-source-2.6.20” package in Ubuntu:
> Won't Fix
> Status in “linux-source-2.6.22” package in Ubuntu:
> Won't Fix
>
> Bug description:
> My laptop is an HP Pavilion dv4000. I'm running up-to-date Feisty.
>
> Regardless of whether my laptop lid is open or closed, I always get
> this:
>
> root@peace:/etc/acpi# cat /proc/acpi/button/lid/*/state
> state: open
>
> This would explain why I can suspend the laptop using Gnome's power
> management menu, but why it doesn't do it when I close the lid. (I
> have specified under power management preferences that it's to suspend
> when I close the lid.)
>
> I know that at some level the lid switch works because when I press it
> the screen backlight turns off (although I can still faintly see that
> the display is still live).
>
> There was one hint of the issue in this email:
> http://lists.opensuse.org/opensuse-mobile/2007-02/msg00016.html
>
> Here's a Ubuntu bug that seems similar, but got rejected:
> https://launchpad.net/ubuntu/+source/kernel-package/+bug/16662
>
> My bug is different than this one:
> https://launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/34389
> because my laptop state is *always* reported as open.
>
> I've attached the output of dmesg and dmidecode.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/89860/+subscriptions
>

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

There is a workaround for this bug which has plagued the HP Compaq nc6120 I'm using ever since, well, forever. I was put on the track of this workaround by reading an old Advogato blog entry (http://www.advogato.org/person/mjg59/diary/62.html) where someone by the handle of 'mjg59' tells about his adventures in ACPI-land and the possible use of setpci to get around ACPI table bugs (which I consider this to be). He does not state which register he changed but I found more information elsewhere which implicated register 0xbb. As to which value to poke there I have experimented a bit as this seems to differ between systems. On the nc6120 the following command, when executed after *each* ACPI-event, restores functionality to the lid switch:

sudo setpci -s 00:1f.0 bb.b=04

I attached a tarball containing two ACPI scripts which make that this command is executed after every ACPI event. Using these scripts, my machine works as expected: the display goes black when the lid switch is pressed/the lid is closed. Opening the lid brings the display back to life. Monitoring the state of the lid switch (cat /proc/acpi/button/lid/C1E9/state on this system) shows the reported state to reflect the actual condition, where before it would stay stuck on 'closed'.

So, if you are also bitten by this bug - which has been around for *years* - you might want to try the setpci command I mentioned. If this works (directly or after changing the poked value) you might want to give these ACPI scripts a try. If you had to change the poked value to make it work, you should also change the value in the /etc/acpi/handler.sh script.

Revision history for this message
gcc (chris+ubuntu-qwirx) wrote :
Download full text (3.9 KiB)

I have seen this problem with an Intel Classmate running Ubuntu 10.04 LTS (2.6.32-36 kernel) and also when using a stock kernel (2.6.32.59) which enabled me to do ACPI debugging.

It turns out that the ACPI DSDT table contains a control method _Q2A, which is repeatedly triggered by the embedded controller when automatic brightness control of the backlight is enabled (Fn+F10). This method sends repeated notifications to the kernel to adjust the brightness level, with a delay. These notifications queue up inside the kernel and cause long delays in dispatch of other notifications, such as LID events.

You can see this happening if you build a kernel with the following options:

CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_DEBUG_FUNC_TRACE=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y

and then run the following commands:

/etc/init.d/rsyslog stop
echo '0x00000004' | sudo tee /sys/module/acpi/parameters/debug_layer
echo '0x00000004' | sudo tee /sys/module/acpi/parameters/debug_level
echo -n 'file ec.c +p' | sudo tee /sys/kernel/debug/dynamic_debug/control
sudo egrep '(push query execution|ev_queue_notify_reques)' /proc/kmsg

This will show you 0x2a (_Q2A) events being constantly triggered by the embedded controller:

<7>[ 380.985859] acpi:ACPI: EC: push query execution (0x2a) on queue
<4>[ 380.996304] evmisc-0125 [07] ev_queue_notify_reques: Dispatching Notify on [FNBT] Node f70152b8 Value 0x83 (**Device Specific**)
<4>[ 380.996331] evmisc-0201 [07] ev_queue_notify_reques: No notify handler for Notify (FNBT, 83) node f70152b8
<4>[ 381.008269] evmisc-0125 [07] ev_queue_notify_reques: Dispatching Notify on [FNBT] Node f70152b8 Value 0x93 (**Device Specific**)
<4>[ 381.008295] evmisc-0201 [07] ev_queue_notify_reques: No notify handler for Notify (FNBT, 93) node f70152b8
<7>[ 381.084229] acpi:ACPI: EC: push query execution (0x2a) on queue
<4>[ 381.120283] evmisc-0125 [07] ev_queue_notify_reques: Dispatching Notify on [FNBT] Node f70152b8 Value 0x83 (**Device Specific**)
<4>[ 381.120310] evmisc-0201 [07] ev_queue_notify_reques: No notify handler for Notify (FNBT, 83) node f70152b8
<4>[ 381.132316] evmisc-0125 [07] ev_queue_notify_reques: Dispatching Notify on [FNBT] Node f70152b8 Value 0x93 (**Device Specific**)
<4>[ 381.132342] evmisc-0201 [07] ev_queue_notify_reques: No notify handler for Notify (FNBT, 93) node f70152b8

Once you press Fn+F7 to stop the automatic brightness control, the Notify queue slowly empties. LID events go to the back of the queue and so they can be executed much later when the queue is full.

It's made worse because the kernel doesn't have a driver for the Notify events (FNBT, 83 and 93) sent by the _Q2A control method, so it doesn't adjust the brightness at all, so next time the EC triggers the _Q2A control method it runs for just as long. If the kernel did adjust the brightness, the next _Q2A would do nothing.

Something similar may be happening in your case and delaying the reception of the LID events that you actually want. You might want to trace all of ACPI instead of just ec.c, since any _E or _L control method could be causing the delay, not just the embedded controller. If you see a long delay between:

<7>...

Read more...

Revision history for this message
taj (othertaj) wrote :

It seems a typical HP problem
For me (NC6320) I check /proc/acpi/video/C083/DOS

I fixed this in 10.04 Lucid, by putting the following lines (both needed, in this order!) into /etc/rc.local

echo 1 > /proc/acpi/video/C083/DOS
echo 0 > /proc/acpi/video/C083/DOS

However, after dist-upgrade to 12.04 this trick does not work anymore...

Revision history for this message
adrian (adrianlzt) wrote :

I'm having the same problem using Linux Mint 13 (based on Ubuntu 12.04) with a Compaq nc6000.

Lid state /proc/acpi/button/lid/C139/status is always set to "open", but if I hibernate (pm-hibernate) and wake-up, lid button works correctly.

acpi_listen shows in both cases (with and without hibernating) the lid events:
button/lid C139 00000080 00000048

The last number is increased in each event.
In each event, /etc/acpi/lid.sh is called. This script checks /proc/acpi/button/lid/*/state and acts in consecuence.

Revision history for this message
adrian (adrianlzt) wrote :

I've been running the 'fwts --interactive' test before and after hibernate.
The most significant parts:

Before:
Test 2 of 3: Test LID buttons on a single open/close.
Got 25 interrupt(s) on GPE gpe10.
Got 13 interrupt(s) on GPE gpe1D.
Got 38 interrupt(s) on GPE gpe_all.
Got 25 SCI interrupt(s).
PASSED: Test 2, Detected ACPI LID events while waiting for LID to closed.
FAILED [HIGH] NoLidState: Test 2, Could not detect lid closed state.
FAILED [HIGH] NoSCIInterrupts: Test 2, Did not detect any SCI interrupts.
FAILED [HIGH] NoGPEInterrupts: Test 2, Did not detect any GPE interrupts.
PASSED: Test 2, Detected ACPI LID events while waiting for LID to open.
PASSED: Test 2, Detected lid open state.

After:
Test 2 of 3: Test LID buttons on a single open/close.
Got 1 interrupt(s) on GPE gpe1D.
Got 1 interrupt(s) on GPE gpe_all.
Got 1 SCI interrupt(s).
PASSED: Test 2, Detected ACPI LID events while waiting for LID to closed.
PASSED: Test 2, Detected lid closed state.
Got 1 interrupt(s) on GPE gpe11.
Got 1 interrupt(s) on GPE gpe1D.
Got 2 interrupt(s) on GPE gpe_all.
Got 2 SCI interrupt(s).
PASSED: Test 2, Detected ACPI LID events while waiting for LID to open.
PASSED: Test 2, Detected lid open state.

Complete results are attached.

Revision history for this message
adrian (adrianlzt) wrote :
Revision history for this message
juanmanuel (rockerito99) wrote :

For those of you with a Samsung laptop showing this problem, please see this issue:

           https://bugs.launchpad.net/ubuntu/+source/acpi/+bug/971061

in particular my last two posts.

I think a kernel patch can be made to flush the events from the embedded controller, at resume, in the same way that I do it with my C program that I attached to that issue for Samsung laptops (and maybe others with the problem). TL;DR: If the events don't get flushed (queried), the GPE of the EC is never triggered again (chicken and egg situation), my little program queries the events and "unstucks" the EC immediatly.

Displaying first 40 and last 40 comments. View all 113 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.