public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* bug in acpid scripts
@ 2004-07-23 19:36 Russell Neches
       [not found] ` <20040723193658.GA3331-5z3TbH0F9hyr8sbHwu5NIg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Russell Neches @ 2004-07-23 19:36 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


I've assumed that the S3 sleep state was broken on my laptop for some
time now, but it turns out that the problem was cased by the behavior of
the distributed powerbtn.sh script. Or, at least, that's where the bug
manifests itself. 

My system always enters S3 without complaining, and resumes without
complaining. Then it immediately begins a clean shutdown. I had assumed
this was caused by general S3 breakage, but the problem is actually
caused by acpid catching the power button event that triggered the
system to resume. It then dutifully calls powerbtn.sh, and the system
shuts down. 

Tossing an "exit" at the beginning of powerbtn.sh fixes the problem
(with an obvious trade-ff), and my laptop suspends and resumes
perfectly. Well, almost perfectly -- I have to unload ohci_hcd before
shutting down, and I have to figure out how to get wireless working
after resume, but those are separate issues.

Is there a sensible way to tell if the system is coming off of S3? I
imagine I could do something like this to get into S3;

	#!/bin/sh
	touch /tmp/S3.ignore.powerbtn
	echo 3 > /proc/acpi/sleep
	sleep 10
	rm /tmp/S3.ignore.powerbtn

and then add this to the beginning of powerbtn.sh;

	if [ -e /tmp/S3.ignore.powerbtn ]; then
		exit
	fi

but that just seems dumb. Any better ideas?

Russell


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click

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

* Re: bug in acpid scripts
       [not found] ` <20040723193658.GA3331-5z3TbH0F9hyr8sbHwu5NIg@public.gmane.org>
@ 2004-07-23 20:39   ` Vernon Mauery
       [not found]     ` <1090615197.9015.7.camel-DNmeG3802II@public.gmane.org>
  2004-07-24 12:50   ` Matthew Garrett
  2004-08-11 13:40   ` Pavel Machek
  2 siblings, 1 reply; 14+ messages in thread
From: Vernon Mauery @ 2004-07-23 20:39 UTC (permalink / raw)
  To: Russell Neches; +Cc: acpi-devel

On Fri, 2004-07-23 at 12:36, Russell Neches wrote:
> Tossing an "exit" at the beginning of powerbtn.sh fixes the problem
> (with an obvious trade-ff), and my laptop suspends and resumes
> perfectly. Well, almost perfectly -- I have to unload ohci_hcd before
> shutting down, and I have to figure out how to get wireless working
> after resume, but those are separate issues.
> 
> Is there a sensible way to tell if the system is coming off of S3? I
> imagine I could do something like this to get into S3;

Adding new wakeup devices helps in this area a lot.  Check out the
latest acpi patch to the kernel -- I had this same issue and applied
the  acpi-20040715 patch, which among other things adds support for
other things waking up the machine (sleep button, lid, etc.)

This simply makes it so you don't have to press the power button to wake
up from S3.  While that is not exactly a direct solution, it was the one
I was looking for anyway.

--Vernon



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click

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

* Re: bug in acpid scripts
       [not found]     ` <1090615197.9015.7.camel-DNmeG3802II@public.gmane.org>
@ 2004-07-23 23:34       ` Russell Neches
  0 siblings, 0 replies; 14+ messages in thread
From: Russell Neches @ 2004-07-23 23:34 UTC (permalink / raw)
  To: Vernon Mauery; +Cc: acpi-devel

> Adding new wakeup devices helps in this area a lot.  Check out the
> latest acpi patch to the kernel -- I had this same issue and applied
> the  acpi-20040715 patch, which among other things adds support for
> other things waking up the machine (sleep button, lid, etc.)
> 
> This simply makes it so you don't have to press the power button to
> wake up from S3.  While that is not exactly a direct solution, it was
> the one I was looking for anyway.

Interesting, though I think the only thing my laptop would be able to
use to trigger S3 would be the lid switch, and I don't think I'd want
that. I think one of the best things about Apple's laptops is how
awesome their sleep support is. The worst thing about them (in my
opinion) that they make it a nightmare to disable the sleep-on-lid-close
feature.

Obviously, some people will love it, so I'm very pleased that we can
configure S3/wakup triggers that way. But, considering tha S3 still
breaks things... 

Oi.

Russell


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click

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

* Re: bug in acpid scripts
       [not found] ` <20040723193658.GA3331-5z3TbH0F9hyr8sbHwu5NIg@public.gmane.org>
  2004-07-23 20:39   ` Vernon Mauery
@ 2004-07-24 12:50   ` Matthew Garrett
       [not found]     ` <1090673420.4412.14.camel-myFlNLNQP+Q@public.gmane.org>
  2004-08-11 13:40   ` Pavel Machek
  2 siblings, 1 reply; 14+ messages in thread
From: Matthew Garrett @ 2004-07-24 12:50 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Fri, 2004-07-23 at 20:36, Russell Neches wrote:

> My system always enters S3 without complaining, and resumes without
> complaining. Then it immediately begins a clean shutdown. I had assumed
> this was caused by general S3 breakage, but the problem is actually
> caused by acpid catching the power button event that triggered the
> system to resume. It then dutifully calls powerbtn.sh, and the system
> shuts down. 

My current workaround is to make button support modular, and then remove
the button module during suspend. The power button event then gets
ignored on wakeup.

-- 
Matthew Garrett | mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click

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

* RE: bug in acpid scripts
@ 2004-07-24 13:23 Li, Shaohua
       [not found] ` <B44D37711ED29844BEA67908EAF36F03665E4F-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Li, Shaohua @ 2004-07-24 13:23 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

I'm working to disable all events sent to acpid (of course including
button event) when system is resuming. The patch is very
straightforward. But I need time to verify if it has side effect for
acpid. 

Thanks,
Shaohua

>-----Original Message-----
>From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:acpi-devel-
>admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Matthew Garrett
>Sent: Saturday, July 24, 2004 8:50 PM
>To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>Subject: Re: [ACPI] bug in acpid scripts
>
>On Fri, 2004-07-23 at 20:36, Russell Neches wrote:
>
>> My system always enters S3 without complaining, and resumes without
>> complaining. Then it immediately begins a clean shutdown. I had
assumed
>> this was caused by general S3 breakage, but the problem is actually
>> caused by acpid catching the power button event that triggered the
>> system to resume. It then dutifully calls powerbtn.sh, and the system
>> shuts down.
>
>My current workaround is to make button support modular, and then
remove
>the button module during suspend. The power button event then gets
>ignored on wakeup.
>
>--
>Matthew Garrett | mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by BEA Weblogic Workshop
>FREE Java Enterprise J2EE developer tools!
>Get your free copy of BEA WebLogic Workshop 8.1 today.
>http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
>_______________________________________________
>Acpi-devel mailing list
>Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/acpi-devel


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id\x10040&op=click

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

* Re: bug in acpid scripts
       [not found]     ` <1090673420.4412.14.camel-myFlNLNQP+Q@public.gmane.org>
@ 2004-07-24 13:51       ` Mattia Dongili
       [not found]         ` <20040724135111.GC2328-MEqNC12sBsHxa7XIdbXXog@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Mattia Dongili @ 2004-07-24 13:51 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Sat, Jul 24, 2004 at 01:50:20PM +0100, Matthew Garrett wrote:
> On Fri, 2004-07-23 at 20:36, Russell Neches wrote:
> 
> > My system always enters S3 without complaining, and resumes without
> > complaining. Then it immediately begins a clean shutdown. I had assumed
> > this was caused by general S3 breakage, but the problem is actually
> > caused by acpid catching the power button event that triggered the
> > system to resume. It then dutifully calls powerbtn.sh, and the system
> > shuts down. 
> 
> My current workaround is to make button support modular, and then remove
> the button module during suspend. The power button event then gets
> ignored on wakeup.

You may simply want to stop acpid just before suspending and restarting
it after having resumed.

-- 
mattia
:wq!


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click

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

* Re: bug in acpid scripts
       [not found]         ` <20040724135111.GC2328-MEqNC12sBsHxa7XIdbXXog@public.gmane.org>
@ 2004-07-24 14:40           ` Luca Capello
  0 siblings, 0 replies; 14+ messages in thread
From: Luca Capello @ 2004-07-24 14:40 UTC (permalink / raw)
  To: ML ACPI-devel

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

Hello,

on 07/24/04 15:51, Mattia Dongili wrote:
> On Sat, Jul 24, 2004 at 01:50:20PM +0100, Matthew Garrett wrote:
>>My current workaround is to make button support modular, and then remove
>>the button module during suspend. The power button event then gets
>>ignored on wakeup.
> You may simply want to stop acpid just before suspending and restarting
> it after having resumed.
or you can use an hack similar to my script attached (original one at
http://sourceforge.net/mailarchive/forum.php?thread_id=3676335&forum_id=6102
as this problem was already reported in this list).

Thx, bye,
Gismo / Luca

=====
luca@gismo:~/download$ cat /etc/acpi/tbtn_power.sh
#!/bin/sh
#
# /etc/acpi/btn-power.sh
# BASH script which acts when the 'power button' is pressed, causing
#   - shutdown
#
# Useful infos at
#   - http://acpi.sourceforge.net/documentation/sleep.html
#
# (C) 2004 - Gismo / Luca Capello <luca.pca.it> http://luca.pca.it

# 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
luca@gismo:~/download$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFBAnTEVAp7Xm10JmkRAjGWAJ9nFHsoIIDg298SXBF4VIDQ6QoK3ACeOBy2
UdlexHHxH2oiVYAOQjtBRM0=
=gB7h
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click

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

* RE: bug in acpid scripts
       [not found] ` <B44D37711ED29844BEA67908EAF36F03665E4F-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2004-07-25  1:42   ` Russell Neches
  0 siblings, 0 replies; 14+ messages in thread
From: Russell Neches @ 2004-07-25  1:42 UTC (permalink / raw)
  To: Li, Shaohua; +Cc: ACPI-Devel

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

Neat! I'd like to help test your patch, if you wouldn't mind posting it.
Is there anything specific behavior (good or bad) you would like me to
check for?

Russell

On Sat, 2004-07-24 at 09:23, Li, Shaohua wrote:
> I'm working to disable all events sent to acpid (of course including
> button event) when system is resuming. The patch is very
> straightforward. But I need time to verify if it has side effect for
> acpid. 
> 
> Thanks,
> Shaohua
> 
> >-----Original Message-----
> >From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:acpi-devel-
> >admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Matthew Garrett
> >Sent: Saturday, July 24, 2004 8:50 PM
> >To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> >Subject: Re: [ACPI] bug in acpid scripts
> >
> >On Fri, 2004-07-23 at 20:36, Russell Neches wrote:
> >
> >> My system always enters S3 without complaining, and resumes without
> >> complaining. Then it immediately begins a clean shutdown. I had
> assumed
> >> this was caused by general S3 breakage, but the problem is actually
> >> caused by acpid catching the power button event that triggered the
> >> system to resume. It then dutifully calls powerbtn.sh, and the system
> >> shuts down.
> >
> >My current workaround is to make button support modular, and then
> remove
> >the button module during suspend. The power button event then gets
> >ignored on wakeup.
> >
> >--
> >Matthew Garrett | mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by BEA Weblogic Workshop
> >FREE Java Enterprise J2EE developer tools!
> >Get your free copy of BEA WebLogic Workshop 8.1 today.
> >http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> >_______________________________________________
> >Acpi-devel mailing list
> >Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> >https://lists.sourceforge.net/lists/listinfo/acpi-devel
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_idG21&alloc_id\x10040&op=click
> _______________________________________________
> Acpi-devel mailing list
> Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/acpi-devel

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

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

* Re: bug in acpid scripts
       [not found] ` <20040723193658.GA3331-5z3TbH0F9hyr8sbHwu5NIg@public.gmane.org>
  2004-07-23 20:39   ` Vernon Mauery
  2004-07-24 12:50   ` Matthew Garrett
@ 2004-08-11 13:40   ` Pavel Machek
  2 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2004-08-11 13:40 UTC (permalink / raw)
  To: Russell Neches; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi!

> Tossing an "exit" at the beginning of powerbtn.sh fixes the problem
> (with an obvious trade-ff), and my laptop suspends and resumes
> perfectly. Well, almost perfectly -- I have to unload ohci_hcd before
> shutting down, and I have to figure out how to get wireless working
> after resume, but those are separate issues.
> 
> Is there a sensible way to tell if the system is coming off of S3? I
> imagine I could do something like this to get into S3;

I guess that kernel should not send that event to userspace...
Fix the kernel.

				Pavel
-- 
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms         



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285

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

* RE: bug in acpid scripts
@ 2004-08-12  7:07 Li, Shaohua
       [not found] ` <B44D37711ED29844BEA67908EAF36F038AD732-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Li, Shaohua @ 2004-08-12  7:07 UTC (permalink / raw)
  To: russell-1vnkWVZi4QaVc3sceRu5cw
  Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

Russell Neches Sunday, July 25, 2004 9:42 AM wrote:
>To: Li, Shaohua
>Cc: ACPI-Devel
>Subject: RE: [ACPI] bug in acpid scripts
>
>Neat! I'd like to help test your patch, if you wouldn't mind posting
it.
>Is there anything specific behavior (good or bad) you would like me to
>check for?
Here is it. The patch is very sample. I didn't observe any side effect
of this patch, but maybe it must be tested widely. Could you please try
it?

Thanks,
Shaohua

>
>Russell
>
>On Sat, 2004-07-24 at 09:23, Li, Shaohua wrote:
>> I'm working to disable all events sent to acpid (of course including
>> button event) when system is resuming. The patch is very
>> straightforward. But I need time to verify if it has side effect for
>> acpid.
>>
>> Thanks,
>> Shaohua
>>
>> >-----Original Message-----
>> >From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:acpi-devel-
>> >admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Matthew Garrett
>> >Sent: Saturday, July 24, 2004 8:50 PM
>> >To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> >Subject: Re: [ACPI] bug in acpid scripts
>> >
>> >On Fri, 2004-07-23 at 20:36, Russell Neches wrote:
>> >
>> >> My system always enters S3 without complaining, and resumes
without
>> >> complaining. Then it immediately begins a clean shutdown. I had
>> assumed
>> >> this was caused by general S3 breakage, but the problem is
actually
>> >> caused by acpid catching the power button event that triggered the
>> >> system to resume. It then dutifully calls powerbtn.sh, and the
system
>> >> shuts down.
>> >
>> >My current workaround is to make button support modular, and then
>> remove
>> >the button module during suspend. The power button event then gets
>> >ignored on wakeup.
>> >
>> >--
>> >Matthew Garrett | mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org
>> >
>> >
>> >
>> >-------------------------------------------------------
>> >This SF.Net email is sponsored by BEA Weblogic Workshop
>> >FREE Java Enterprise J2EE developer tools!
>> >Get your free copy of BEA WebLogic Workshop 8.1 today.
>> >http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
>> >_______________________________________________
>> >Acpi-devel mailing list
>> >Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> >https://lists.sourceforge.net/lists/listinfo/acpi-devel
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by BEA Weblogic Workshop
>> FREE Java Enterprise J2EE developer tools!
>> Get your free copy of BEA WebLogic Workshop 8.1 today.
>> http://ads.osdn.com/?ad_idG21&alloc_id\x10040&op=click
>> _______________________________________________
>> Acpi-devel mailing list
>> Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> https://lists.sourceforge.net/lists/listinfo/acpi-devel

[-- Attachment #2: maskevent.patch --]
[-- Type: application/octet-stream, Size: 2105 bytes --]

===== drivers/acpi/bus.c 1.42 vs edited =====
--- 1.42/drivers/acpi/bus.c	2004-05-12 12:36:55 +08:00
+++ edited/drivers/acpi/bus.c	2004-08-12 14:39:43 +08:00
@@ -283,6 +283,7 @@ LIST_HEAD(acpi_bus_event_list);
 DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
 
 extern int			event_is_open;
+extern int			acpi_event_is_masked;
 
 int
 acpi_bus_generate_event (
@@ -299,7 +300,7 @@ acpi_bus_generate_event (
 		return_VALUE(-EINVAL);
 
 	/* drop event on the floor if no one's listening */
-	if (!event_is_open)
+	if (!event_is_open || acpi_event_is_masked)
 		return_VALUE(0);
 
 	event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
===== drivers/acpi/event.c 1.5 vs edited =====
--- 1.5/drivers/acpi/event.c	2004-05-29 17:12:55 +08:00
+++ edited/drivers/acpi/event.c	2004-08-12 14:40:13 +08:00
@@ -17,7 +17,8 @@ ACPI_MODULE_NAME		("event")
 
 /* Global vars for handling event proc entry */
 static spinlock_t		acpi_system_event_lock = SPIN_LOCK_UNLOCKED;
-int				event_is_open = 0;
+int				event_is_open;
+int				acpi_event_is_mask;
 extern struct list_head		acpi_bus_event_list;
 extern wait_queue_head_t	acpi_bus_event_queue;
 
===== drivers/acpi/sleep/main.c 1.38 vs edited =====
--- 1.38/drivers/acpi/sleep/main.c	2004-07-14 13:29:13 +08:00
+++ edited/drivers/acpi/sleep/main.c	2004-08-12 14:41:13 +08:00
@@ -70,7 +70,7 @@ static int acpi_pm_prepare(u32 pm_state)
  *	arch-specific assembly, which in turn call acpi_enter_sleep_state().
  *	It's unfortunate, but it works. Please fix if you're feeling frisky.
  */
-
+extern int acpi_event_is_mask;
 static int acpi_pm_enter(u32 pm_state)
 {
 	acpi_status status = AE_OK;
@@ -89,6 +89,7 @@ static int acpi_pm_enter(u32 pm_state)
 
 	local_irq_save(flags);
 	acpi_enable_wakeup_device(acpi_state);
+	acpi_event_is_mask = 1;
 	switch (pm_state)
 	{
 	case PM_SUSPEND_STANDBY:
@@ -139,6 +140,7 @@ static int acpi_pm_finish(u32 pm_state)
 
 	acpi_leave_sleep_state(acpi_state);
 	acpi_disable_wakeup_device(acpi_state);
+	acpi_event_is_mask = 0;
 
 	/* reset firmware waking vector */
 	acpi_set_firmware_waking_vector((acpi_physical_address) 0);

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

* Re: bug in acpid scripts
       [not found] ` <B44D37711ED29844BEA67908EAF36F038AD732-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2004-08-13  0:24   ` Nathan Bryant
  2004-08-13  6:18   ` Stefan Seyfried
  1 sibling, 0 replies; 14+ messages in thread
From: Nathan Bryant @ 2004-08-13  0:24 UTC (permalink / raw)
  To: Li, Shaohua
  Cc: russell-1vnkWVZi4QaVc3sceRu5cw,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

Li, Shaohua wrote:

>Russell Neches Sunday, July 25, 2004 9:42 AM wrote:
>  
>
>>To: Li, Shaohua
>>Cc: ACPI-Devel
>>Subject: RE: [ACPI] bug in acpid scripts
>>
>>Neat! I'd like to help test your patch, if you wouldn't mind posting
>>    
>>
>it.
>  
>
>>Is there anything specific behavior (good or bad) you would like me to
>>check for?
>>    
>>
>Here is it. The patch is very sample. I didn't observe any side effect
>of this patch, but maybe it must be tested widely. Could you please try
>it?
>  
>
Shaohua,

My system has the same problem. Unfortunately, your patch doesn't fix 
it. Also, I had to apply the attached just to get it to build (against 
current -rc4 bitkeeper plus linux-acpi-test-2.6.8)

Nathan

[-- Attachment #2: maskevent.patch2 --]
[-- Type: text/plain, Size: 363 bytes --]

===== drivers/acpi/bus.c 1.43 vs edited =====
--- 1.43/drivers/acpi/bus.c	2004-08-12 02:39:43 -04:00
+++ edited/drivers/acpi/bus.c	2004-08-12 20:09:51 -04:00
@@ -283,7 +283,7 @@
 DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
 
 extern int			event_is_open;
-extern int			acpi_event_is_masked;
+static int			acpi_event_is_masked;
 
 int
 acpi_bus_generate_event (

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

* RE: bug in acpid scripts
@ 2004-08-13  0:52 Li, Shaohua
       [not found] ` <B44D37711ED29844BEA67908EAF36F038ADB3E-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Li, Shaohua @ 2004-08-13  0:52 UTC (permalink / raw)
  To: Nathan Bryant
  Cc: russell-1vnkWVZi4QaVc3sceRu5cw,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

Hi,
Oops, I'm sorry the patch has typo. I changed the parameter name after
my test, but I forgot changing all. Could you please try this one? Sorry
for the inconvenience.

Thanks,
Shaohua

>-----Original Message-----
>From: Nathan Bryant [mailto:nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org]
>Sent: Friday, August 13, 2004 8:25 AM
>To: Li, Shaohua
>Cc: russell-1vnkWVZi4QaVc3sceRu5cw@public.gmane.org; acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>Subject: Re: [ACPI] bug in acpid scripts
>
>Li, Shaohua wrote:
>
>>Russell Neches Sunday, July 25, 2004 9:42 AM wrote:
>>
>>
>>>To: Li, Shaohua
>>>Cc: ACPI-Devel
>>>Subject: RE: [ACPI] bug in acpid scripts
>>>
>>>Neat! I'd like to help test your patch, if you wouldn't mind posting
>>>
>>>
>>it.
>>
>>
>>>Is there anything specific behavior (good or bad) you would like me
to
>>>check for?
>>>
>>>
>>Here is it. The patch is very sample. I didn't observe any side effect
>>of this patch, but maybe it must be tested widely. Could you please
try
>>it?
>>
>>
>Shaohua,
>
>My system has the same problem. Unfortunately, your patch doesn't fix
>it. Also, I had to apply the attached just to get it to build (against
>current -rc4 bitkeeper plus linux-acpi-test-2.6.8)
>
>Nathan

[-- Attachment #2: maskevent.patch --]
[-- Type: application/octet-stream, Size: 2101 bytes --]

===== drivers/acpi/bus.c 1.42 vs edited =====
--- 1.42/drivers/acpi/bus.c	2004-05-12 12:36:55 +08:00
+++ edited/drivers/acpi/bus.c	2004-08-12 14:39:43 +08:00
@@ -283,6 +283,7 @@ LIST_HEAD(acpi_bus_event_list);
 DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
 
 extern int			event_is_open;
+extern int			acpi_event_is_mask;
 
 int
 acpi_bus_generate_event (
@@ -299,7 +300,7 @@ acpi_bus_generate_event (
 		return_VALUE(-EINVAL);
 
 	/* drop event on the floor if no one's listening */
-	if (!event_is_open)
+	if (!event_is_open || acpi_event_is_mask)
 		return_VALUE(0);
 
 	event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
===== drivers/acpi/event.c 1.5 vs edited =====
--- 1.5/drivers/acpi/event.c	2004-05-29 17:12:55 +08:00
+++ edited/drivers/acpi/event.c	2004-08-12 14:40:13 +08:00
@@ -17,7 +17,8 @@ ACPI_MODULE_NAME		("event")
 
 /* Global vars for handling event proc entry */
 static spinlock_t		acpi_system_event_lock = SPIN_LOCK_UNLOCKED;
-int				event_is_open = 0;
+int				event_is_open;
+int				acpi_event_is_mask;
 extern struct list_head		acpi_bus_event_list;
 extern wait_queue_head_t	acpi_bus_event_queue;
 
===== drivers/acpi/sleep/main.c 1.38 vs edited =====
--- 1.38/drivers/acpi/sleep/main.c	2004-07-14 13:29:13 +08:00
+++ edited/drivers/acpi/sleep/main.c	2004-08-12 14:41:13 +08:00
@@ -70,7 +70,7 @@ static int acpi_pm_prepare(u32 pm_state)
  *	arch-specific assembly, which in turn call acpi_enter_sleep_state().
  *	It's unfortunate, but it works. Please fix if you're feeling frisky.
  */
-
+extern int acpi_event_is_mask;
 static int acpi_pm_enter(u32 pm_state)
 {
 	acpi_status status = AE_OK;
@@ -89,6 +89,7 @@ static int acpi_pm_enter(u32 pm_state)
 
 	local_irq_save(flags);
 	acpi_enable_wakeup_device(acpi_state);
+	acpi_event_is_mask = 1;
 	switch (pm_state)
 	{
 	case PM_SUSPEND_STANDBY:
@@ -139,6 +140,7 @@ static int acpi_pm_finish(u32 pm_state)
 
 	acpi_leave_sleep_state(acpi_state);
 	acpi_disable_wakeup_device(acpi_state);
+	acpi_event_is_mask = 0;
 
 	/* reset firmware waking vector */
 	acpi_set_firmware_waking_vector((acpi_physical_address) 0);

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

* Re: bug in acpid scripts
       [not found] ` <B44D37711ED29844BEA67908EAF36F038ADB3E-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2004-08-13  0:55   ` Nathan Bryant
  0 siblings, 0 replies; 14+ messages in thread
From: Nathan Bryant @ 2004-08-13  0:55 UTC (permalink / raw)
  To: Li, Shaohua
  Cc: russell-1vnkWVZi4QaVc3sceRu5cw,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

Li, Shaohua wrote:

>Hi,
>Oops, I'm sorry the patch has typo. I changed the parameter name after
>my test, but I forgot changing all. Could you please try this one? Sorry
>for the inconvenience.
>
>Thanks,
>Shaohua
>
Yes, I just changed your patch to the following and it works. I can 
confirm it fixes the problem, no adverse effects

[-- Attachment #2: maskevent.patch3 --]
[-- Type: text/plain, Size: 2879 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/12 20:47:40-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org 
#   This is a fixed version of shaohua's double-button-event patch
# 
# drivers/acpi/sleep/main.c
#   2004/08/12 20:47:32-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +3 -3
#   Fixed shaohua's double-button event patch
# 
# drivers/acpi/event.c
#   2004/08/12 20:47:32-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +1 -1
#   Fixed shaohua's double-button event patch
# 
# drivers/acpi/sleep/main.c
#   2004/08/12 02:41:13-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +3 -1
#   Import patch maskevent.patch
# 
# drivers/acpi/event.c
#   2004/08/12 02:40:13-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +2 -1
#   Import patch maskevent.patch
# 
# drivers/acpi/bus.c
#   2004/08/12 02:39:43-04:00 nbryant-p32f3XyCuykqcZcGjlUOXw@public.gmane.org +2 -1
#   Import patch maskevent.patch
# 
diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c
--- a/drivers/acpi/bus.c	2004-08-12 20:49:37 -04:00
+++ b/drivers/acpi/bus.c	2004-08-12 20:49:37 -04:00
@@ -283,6 +283,7 @@
 DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
 
 extern int			event_is_open;
+extern int			acpi_event_is_masked;
 
 int
 acpi_bus_generate_event (
@@ -299,7 +300,7 @@
 		return_VALUE(-EINVAL);
 
 	/* drop event on the floor if no one's listening */
-	if (!event_is_open)
+	if (!event_is_open || acpi_event_is_masked)
 		return_VALUE(0);
 
 	event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
diff -Nru a/drivers/acpi/event.c b/drivers/acpi/event.c
--- a/drivers/acpi/event.c	2004-08-12 20:49:37 -04:00
+++ b/drivers/acpi/event.c	2004-08-12 20:49:37 -04:00
@@ -17,7 +17,8 @@
 
 /* Global vars for handling event proc entry */
 static spinlock_t		acpi_system_event_lock = SPIN_LOCK_UNLOCKED;
-int				event_is_open = 0;
+int				event_is_open;
+int				acpi_event_is_masked;
 extern struct list_head		acpi_bus_event_list;
 extern wait_queue_head_t	acpi_bus_event_queue;
 
diff -Nru a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
--- a/drivers/acpi/sleep/main.c	2004-08-12 20:49:37 -04:00
+++ b/drivers/acpi/sleep/main.c	2004-08-12 20:49:37 -04:00
@@ -73,7 +73,7 @@
  *	arch-specific assembly, which in turn call acpi_enter_sleep_state().
  *	It's unfortunate, but it works. Please fix if you're feeling frisky.
  */
-
+extern int acpi_event_is_masked;
 static int acpi_pm_enter(u32 pm_state)
 {
 	acpi_status status = AE_OK;
@@ -92,6 +92,7 @@
 
 	local_irq_save(flags);
 	acpi_enable_wakeup_device(acpi_state);
+	acpi_event_is_masked = 1;
 	switch (pm_state)
 	{
 	case PM_SUSPEND_STANDBY:
@@ -142,6 +143,7 @@
 
 	acpi_leave_sleep_state(acpi_state);
 	acpi_disable_wakeup_device(acpi_state);
+	acpi_event_is_masked = 0;
 
 	/* reset firmware waking vector */
 	acpi_set_firmware_waking_vector((acpi_physical_address) 0);

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

* Re: bug in acpid scripts
       [not found] ` <B44D37711ED29844BEA67908EAF36F038AD732-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2004-08-13  0:24   ` Nathan Bryant
@ 2004-08-13  6:18   ` Stefan Seyfried
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Seyfried @ 2004-08-13  6:18 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Thu, Aug 12, 2004 at 03:07:17PM +0800, Li, Shaohua wrote:

> Here is it. The patch is very sample. I didn't observe any side effect
> of this patch, but maybe it must be tested widely. Could you please try
> it?

can this work? I have not tested but it seems strange to me.
acpi_event_is_masked vs. acpi_event_is_mask

===== drivers/acpi/bus.c 1.42 vs edited =====
+extern int			acpi_event_is_masked;
[...]
+	if (!event_is_open || acpi_event_is_masked)

===== drivers/acpi/event.c 1.5 vs edited =====
+int				acpi_event_is_mask;
 
===== drivers/acpi/sleep/main.c 1.38 vs edited =====
+extern int acpi_event_is_mask;
[...]
+	acpi_event_is_mask = 1;
[...]
+	acpi_event_is_mask = 0;
-- 
Stefan Seyfried



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285

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

end of thread, other threads:[~2004-08-13  6:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-23 19:36 bug in acpid scripts Russell Neches
     [not found] ` <20040723193658.GA3331-5z3TbH0F9hyr8sbHwu5NIg@public.gmane.org>
2004-07-23 20:39   ` Vernon Mauery
     [not found]     ` <1090615197.9015.7.camel-DNmeG3802II@public.gmane.org>
2004-07-23 23:34       ` Russell Neches
2004-07-24 12:50   ` Matthew Garrett
     [not found]     ` <1090673420.4412.14.camel-myFlNLNQP+Q@public.gmane.org>
2004-07-24 13:51       ` Mattia Dongili
     [not found]         ` <20040724135111.GC2328-MEqNC12sBsHxa7XIdbXXog@public.gmane.org>
2004-07-24 14:40           ` Luca Capello
2004-08-11 13:40   ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2004-07-24 13:23 Li, Shaohua
     [not found] ` <B44D37711ED29844BEA67908EAF36F03665E4F-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-07-25  1:42   ` Russell Neches
2004-08-12  7:07 Li, Shaohua
     [not found] ` <B44D37711ED29844BEA67908EAF36F038AD732-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-08-13  0:24   ` Nathan Bryant
2004-08-13  6:18   ` Stefan Seyfried
2004-08-13  0:52 Li, Shaohua
     [not found] ` <B44D37711ED29844BEA67908EAF36F038ADB3E-4yWAQGcml65pB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-08-13  0:55   ` Nathan Bryant

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