public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* clear/enable power button on resume
@ 2004-03-07 18:52 Timo Hoenig
       [not found] ` <1078685555.541.9.camel-eqrHSpLoP5M@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Timo Hoenig @ 2004-03-07 18:52 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

Hello,

after trying 2.6.4-rc1 I discovered some strange behavior: My machine
simply shut down after resuming from S3.

Since [ACPI] ACPICA 20040220 from Bob Moore there is code to
clear/enable the power button on resume in acpi_leave_sleep_state().
This leads to an acpi event which is handled by acpid if active. In my
case acpid executed the corresponding shutdown script.

I guess this is going to clutter many people.

Regards,

   Timo

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clear/enable power button on resume
       [not found] ` <1078685555.541.9.camel-eqrHSpLoP5M@public.gmane.org>
@ 2004-03-07 19:38   ` Luca Capello
       [not found]     ` <404B7A1B.80006-wlebWZzHoyE@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Capello @ 2004-03-07 19:38 UTC (permalink / raw)
  To: ML ACPI-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

on 03/07/04 19:52, Timo Hoenig wrote:
> after trying 2.6.4-rc1 I discovered some strange behavior: My machine
> simply shut down after resuming from S3.
>
> Since [ACPI] ACPICA 20040220 from Bob Moore there is code to
> clear/enable the power button on resume in acpi_leave_sleep_state().
> This leads to an acpi event which is handled by acpid if active. In my
> case acpid executed the corresponding shutdown script.
>
> I guess this is going to clutter many people.
this is a known problem at least for resuming from S1, please refers to the
thread called 'ASUS M3N and sleep states' started 20031227 by me or the direct
link to the relevant post here:
http://sourceforge.net/mailarchive/forum.php?thread_id=3676335&forum_id=6102

BTW, my simple workaround for S1 is using this trick on the ACPI power button
script:
=====
#!/bin/sh
#
# /etc/acpi/btn-power.sh

# shutdown
echo "Checking if resuming from S1..."
if tail -n 5 /var/log/messages | grep 'Restarting tasks... done'
then
	echo "Resuming from S1, so not acting, exited."
	exit 0
else
	echo "Shutdown in progress"
fi

if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
then
    dcop --all-users ksmserver ksmserver logout 0 2 0 && exit 0
fi
/sbin/init 0
=====

Thx, bye,
Gismo / Luca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFAS3oaVAp7Xm10JmkRAha3AJsF9j0VIFD4DHxXq/n8KpmgYiTFDACcCZ63
8pP1UHalIUnSpiRfibleBkU=
=58ik
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clear/enable power button on resume
       [not found]     ` <404B7A1B.80006-wlebWZzHoyE@public.gmane.org>
@ 2004-03-07 20:02       ` Timo Hoenig
       [not found]         ` <1078689765.541.20.camel-eqrHSpLoP5M@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Timo Hoenig @ 2004-03-07 20:02 UTC (permalink / raw)
  To: ML ACPI-devel

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

On Sun, 2004-03-07 at 20:38, Luca Capello wrote:
> this is a known problem at least for resuming from S1, please refers to the
> thread called 'ASUS M3N and sleep states' started 20031227 by me or the direct
> link to the relevant post here:
> http://sourceforge.net/mailarchive/forum.php?thread_id=3676335&forum_id=6102

Since S1 is broken for me, I can not verify that.

> BTW, my simple workaround for S1 is using this trick on the ACPI power button
> script:

Thanks. But I don't use the power event anyway. As long as acpi works I
am happy with suspend / resume. rm -rf /etc/acpi/events/powerbtn did it
for me.

Isn't the acpi spec telling whether the pressing of the power button
after suspending has to be reported to the OS?

  Timo

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clear/enable power button on resume
       [not found]         ` <1078689765.541.20.camel-eqrHSpLoP5M@public.gmane.org>
@ 2004-03-07 22:43           ` Sebastian Seifert
       [not found]             ` <20040307224318.GA1551-nlVyBo/8EO9N0TnZuCh8vA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Seifert @ 2004-03-07 22:43 UTC (permalink / raw)
  To: Timo Hoenig; +Cc: ML ACPI-devel

On Sun, Mar 07, 2004 at 09:02:46PM +0100, Timo Hoenig wrote:
> Thanks. But I don't use the power event anyway. As long as acpi works I
> am happy with suspend / resume. rm -rf /etc/acpi/events/powerbtn did it
> for me.

That's what I did, too. On my system, it happens after S3 sleep (I
haven't tested S1/S2). 

And the power button is the only way to power on after S3, since all
other wake-capable devices aren't enabled.

> Isn't the acpi spec telling whether the pressing of the power button
> after suspending has to be reported to the OS?

The ACPI spec says that the pressing of a button (e.g. the power button)
that leads to a wake event is reported differently to the OS. The Notify
value (second column in output of /proc/acpi/event) of a regular button event 
is 0x80, that of a wake event is 0x02. Nevertheless, on my system, 0x80
is generated for a power button wake. Strange.

Sebastian


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clear/enable power button on resume
       [not found]             ` <20040307224318.GA1551-nlVyBo/8EO9N0TnZuCh8vA@public.gmane.org>
@ 2004-03-07 23:27               ` Timo Hoenig
  0 siblings, 0 replies; 5+ messages in thread
From: Timo Hoenig @ 2004-03-07 23:27 UTC (permalink / raw)
  To: ML ACPI-devel

[-- Attachment #1: Type: text/plain, Size: 929 bytes --]

On Sun, 2004-03-07 at 23:43, Sebastian Seifert wrote:
> The ACPI spec says that the pressing of a button (e.g. the power button)
> that leads to a wake event is reported differently to the OS. The Notify
> value (second column in output of /proc/acpi/event) of a regular button event 
> is 0x80, that of a wake event is 0x02. Nevertheless, on my system, 0x80
> is generated for a power button wake. Strange.

Yes. Same here.

[root-eqrHSpLoP5M@public.gmane.org:~]$ cat
acpid.log_2.6.4-rc1-mm2                                                                                                                (0:23)
Linux 2.6.4-rc1-mm4
[Sun Mar  7 19:19:40 2004] 1 client rule loaded
[Sun Mar  7 19:19:50 2004] received event "button/power PWRF 00000080
00000006"
[Sun Mar  7 19:19:50 2004] notifying client 525[1000:1000]
[Sun Mar  7 19:19:50 2004] completed event "button/power PWRF 00000080
00000006"


  Timo

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-07 23:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-07 18:52 clear/enable power button on resume Timo Hoenig
     [not found] ` <1078685555.541.9.camel-eqrHSpLoP5M@public.gmane.org>
2004-03-07 19:38   ` Luca Capello
     [not found]     ` <404B7A1B.80006-wlebWZzHoyE@public.gmane.org>
2004-03-07 20:02       ` Timo Hoenig
     [not found]         ` <1078689765.541.20.camel-eqrHSpLoP5M@public.gmane.org>
2004-03-07 22:43           ` Sebastian Seifert
     [not found]             ` <20040307224318.GA1551-nlVyBo/8EO9N0TnZuCh8vA@public.gmane.org>
2004-03-07 23:27               ` Timo Hoenig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox