Skip to contentSkip to conversation

Lid switch not waking machine

DISCUSSION Matthew Garrett 4 participants 6 messages Jul 7, 2003 – Jul 9, 2003 3 messages not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

If I press the lid switch to put my laptop to sleep, releasing it doesn't wake it up. acpi_hw_enable_gpe_for_wakeup only seems to be called from acpi_enable_gpe and only if ACPI_EVENT_WAKE_ENABLE is set - acpi_enable_gpe only seems to be called from acpi_ec_gpe_query, and then only as:

        acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);

So, should this function be being called for my lid switch, and if so how? Or am I barking up the wrong tree entirely? Windows resumes happily if the switch is released, so it's presumably capable of generating a wakeup event.

Signature · 8 lines
Matthew Garrett | [email protected]


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Matthew Garrett

So, should this function be being called for my lid switch, and if so how? Or am I barking up the wrong tree entirely? Windows resumes happily if the switch is released, so it's presumably capable of generating a wakeup event.

The plot thickens. If I suspend with the lid switch and then release it, I have to wake the system with the power button. The system resumes, but no more ACPI events are generated. If I suspend with the sleep button, I can resume with the power button and ACPI events are still generated. However, if I suspend with the sleep button, press and release the lid switch while the system is suspended and then resume with the power button, the symptoms are identical to having suspending with the lid switch - no more ACPI events are generated. So, somehow, the act of causing a lid switch event while the machine is suspended causes ACPI to cease being useful.

Is there useful debugging output I can generate here?

Signature · 8 lines
Matthew Garrett | [email protected]


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
#3 lore raw

From: "Matthew Garrett" <[email protected]>

Quoted 9 lines · Matthew Garrett
Quoted 5 lines

So, should this function be being called for my lid switch, and if so how? Or am I barking up the wrong tree entirely? Windows resumes happily if the switch is released, so it's presumably capable of generating a wakeup event.

The plot thickens. If I suspend with the lid switch and then release it, I have to wake the system with the power button. The system resumes, but

This is normal. Every laptop I've used (even in Windows) expects to be woken from sleep states with the power button - if your laptop had a dedicated sleep button, you might use that instead, but the lid switch is never, ime, used for wakeup.

Quoted 1 line

no more ACPI events are generated. If I suspend with the sleep button, I

This, however, seems wrong. What you should get when you wake with the power button is a power button event immediately followed by a lid switch event - and then any other events.

derek

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01

#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Derek Broughton

From: "Matthew Garrett" <[email protected]>

Quoted 2 lines

The plot thickens. If I suspend with the lid switch and then release it, I have to wake the system with the power button. The system resumes, but

This is normal. Every laptop I've used (even in Windows) expects to be woken from sleep states with the power button - if your laptop had a dedicated sleep button, you might use that instead, but the lid switch is never, ime, used for wakeup.

Toshibas supplied with WinXP have the option, switched on by default.

Signature · 25 lines
Simon Gates - developer, Email: [email protected]
Tao Group, 62/63 Suttons Business Park, Earley, Reading, Berkshire, RG6
1AZ.
Tel: +44 118 901 2999, Fax: +44 118 901 2963, Web:
http://www.tao-group.com

The contents of this e-mail and any attachments are confidential and may
be legally privileged. If you have received this e-mail and you are not
a named addressee, please inform us as soon as possible on
+44 118 901 2999 and then delete the e-mail from your system. If you are
not a named addressee you must not copy, use, disclose, distribute,
print or rely on this e-mail. Any views expressed in this e-mail or any
attachments may not necessarily reflect those of Tao's management.
Although we routinely screen for viruses, addressees should scan this
e-mail and any attachments for viruses. Tao makes no representation or
warranty as to the absence of viruses in this e-mail or any attachments.
Please note that for the protection of our business, we may monitor and
read e-mails sent to and from our server(s).


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
#6 lore raw
In reply to a message not in the archive
Quoted 8 lines · Derek Broughton

From: "Matthew Garrett" <[email protected]>

Quoted 2 lines

The plot thickens. If I suspend with the lid switch and then release it, I have to wake the system with the power button. The system resumes, but

This is normal. Every laptop I've used (even in Windows) expects to be woken from sleep states with the power button - if your laptop had a dedicated sleep button, you might use that instead, but the lid switch is never, ime, used for wakeup.

Under Windows, opening the lid results in the system waking, so it seems that the hardware is capable of it. It'd be nice if the same were possible under Linux.

Quoted 5 lines
Quoted 1 line

no more ACPI events are generated. If I suspend with the sleep button, I

This, however, seems wrong. What you should get when you wake with the power button is a power button event immediately followed by a lid switch event - and then any other events.

Before suspending (I've stopped acpid so I can do this by hand):

mjg59@asparagine:/tmp$ sudo cat /proc/acpi/event
button/lid LID 00000080 00000001
button/lid LID 00000080 00000002
(once for down, once for up)
button/sleep SBTN 00000080 00000003
(pressing the sleep button) 

At this point, I do /etc/acpi/default.sh button SBTN and the machine suspends. I can press the power button or (for some reason) the Fn key and the machine resumes - my cat process has died with an Input/output error. ACPI carries on working, as shown below.

mjg59@asparagine:/tmp$ sudo cat /proc/acpi/event
button/lid LID 00000080 00000003
button/lid LID 00000080 00000004
(lid button still works)
button/sleep SBTN 00000080 00000004
(sleep button still works)

Suspend again - this time I press the lid switch while the system is suspended. Power button and Fn key still wake the system, but from now on no ACPI events are generated. I can still do things like control the CPU throttling and fan state by hand. Removing the ac adapter leaves its state as "on-line". cat /proc/acpi/button/lid/LID/state shows "open" even when it's not. It's as if the hardware is waiting for something to deal with the lid up event and not doing anything else until that's happened.

I've stuck my DSDT at http://www.codon.org.uk/~mjg59/240x.dsdt if that's any use.

Signature · 8 lines
Matthew Garrett | [email protected]


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
#8 lore raw
In reply to a message not in the archive
Quoted 5 lines · Matthew Garrett
Quoted 4 lines · Derek Broughton

From: "Matthew Garrett" <[email protected]>

Quoted 2 lines

The plot thickens. If I suspend with the lid switch and then release it, I have to wake the system with the power button. The system resumes, but

Quoted 8 lines
Quoted 4 lines

This is normal. Every laptop I've used (even in Windows) expects to be woken from sleep states with the power button - if your laptop had a dedicated sleep button, you might use that instead, but the lid switch is never, ime, used for wakeup.

Under Windows, opening the lid results in the system waking, so it seems that the hardware is capable of it. It'd be nice if the same were possible under Linux.

Under FreeBSD, my IBM T23 suspends/resumes (S3) based on the lid switch just fine.

-Nate

-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps