From owner-acpi-jp@jp.freebsd.org  Fri Nov 23 00:09:45 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id AAA06599;
	Fri, 23 Nov 2001 00:09:45 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (root@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id AAA06594
	for <acpi-jp@jp.freebsd.org>; Fri, 23 Nov 2001 00:09:44 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92])
	(authenticated as iwa with CRAM-MD5)
	by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id fAMF9hW78424;
	Fri, 23 Nov 2001 00:09:43 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Date: Fri, 23 Nov 2001 00:09:38 +0900 (JST)
Message-Id: <20011123.000938.74753540.iwasaki@jp.FreeBSD.org>
To: acpi-jp@jp.freebsd.org, mark@grondar.za
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
In-Reply-To: <20011122.232410.74757488.iwasaki@jp.FreeBSD.org>
References: <200111221043.fAMAhBN35624@grimreaper.grondar.org>
	<20011122.232410.74757488.iwasaki@jp.FreeBSD.org>
X-Mailer: Mew version 2.0 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1481
Subject: [acpi-jp 1481] Re: Toshiba Libretto 110CT ACPI funnies
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

Hi, mark.

> > I can make the machine sleep or suspend with acpiconf, but the
> > only way to wake it up is with the power button. If I do this,
> > it wakes up normally, and then promptly powers off (nicely)!
> 
> Last time we had this problem with old acpi driver, and added
> workaround for it ignoring power button event for 5 (or 10? not sure)
> seconds after wakeup.
> I think we probably need the same kind hack for some laptops.
> I'll try to make it later.

Could try this?  If NG, I can make another patch.

Thanks

Index: acpi.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v
retrieving revision 1.49
diff -u -r1.49 acpi.c
--- acpi.c	15 Nov 2001 15:12:08 -0000	1.49
+++ acpi.c	22 Nov 2001 15:00:24 -0000
@@ -1428,11 +1453,17 @@
 static void
 acpi_system_eventhandler_sleep(void *arg, int state)
 {
-    FUNCTION_TRACE_U32(__func__, state);
+    struct acpi_softc	*sc = arg;
 
+    FUNCTION_TRACE_U32(__func__, state);
     ACPI_LOCK;
+
+    if (sc->acpi_sstate != ACPI_STATE_S0)
+	goto out;
+
     if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX)
-	acpi_SetSleepState((struct acpi_softc *)arg, state);
+	acpi_SetSleepState(sc, state);
+out:
     ACPI_UNLOCK;
     return_VOID;
 }
