Bug 8813

Summary: acpi does not rescan button event on resume, leading to userspace confusion
Product: ACPI Reporter: Richard Hughes (richard)
Component: Power-OtherAssignee: acpi_power-other
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, bunk, lenb
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.23rc1 Tree: Mainline
Regression: ---
Bug Depends on:    
Bug Blocks: 7216    
Attachments: patch to fix the issue
patch in 2.6.23-rc3-git9

Description Richard Hughes 2007-07-26 05:10:58 UTC
Most recent kernel where this bug did not occur: N/A
Distribution: Fedora core 7 with vanilla kernel
Hardware Environment: ThinkPad X60, tested with 7 various other machines
Software Environment: Stock F7 with vanilla kernel
Problem Description:

On resume we need to refresh the lid status as we will not get an event if
the lid opening was what triggered the suspend.
This manifests itself in users never getting a "lid open" event when a
suspend happens because of lid close on hardware that supports wake on
lid open. This makes userspace gets very confused indeed.
Patch attached forces a check of the lid status in the resume handler.

Steps to reproduce:

1. install linux
2. start evtest or gnome-power-manager
3. shut lid [machine suspends]
4. open lid [machine resumes]
5. observe no lid open event, userspace still thinks the lid is down
6. shut lid [machine ignores "duplicate event" and does not suspend
7. open lid [machine gets lid up event]
8. shut lid [machine suspends]
Comment 1 Richard Hughes 2007-07-26 05:11:54 UTC
Created attachment 12154 [details]
patch to fix the issue

fixes the problem by rescanning the lid on resume.
Comment 2 Len Brown 2007-08-03 13:08:39 UTC
applied to acpi-test

BTW. what in user-space is monitoring the lid state?
Comment 3 Richard Hughes 2007-08-03 13:11:12 UTC
Cheers. HAL, and indirectly, gnome-power-manager.
Comment 4 Len Brown 2007-08-25 21:10:14 UTC
Created attachment 12539 [details]
patch in 2.6.23-rc3-git9

This patch shipped in 2.6.23-rc3-git9.
79d2dfaa4e787f94b7f65f4611bc7d1c8d85fabc
Please re-open this bug if there is still an issue after that release.