From owner-freebsd-acpi@FreeBSD.ORG Mon May 23 01:32:56 2005 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3DBCC16A41C for ; Mon, 23 May 2005 01:32:56 +0000 (GMT) (envelope-from Alex.Kovalenko@verizon.net) Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1E9343D49 for ; Mon, 23 May 2005 01:32:55 +0000 (GMT) (envelope-from Alex.Kovalenko@verizon.net) Received: from RabbitsDen ([70.21.190.81]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IGX00J255MPBK0C@vms046.mailsrvcs.net> for acpi@freebsd.org; Sun, 22 May 2005 20:32:49 -0500 (CDT) Date: Sun, 22 May 2005 21:30:42 -0400 From: "Alexandre \"Sunny\" Kovalenko" To: acpi@freebsd.org Message-id: <1116811842.671.22.camel@RabbitsDen> MIME-version: 1.0 X-Mailer: Evolution 2.2.2 FreeBSD GNOME Team Port Content-type: multipart/mixed; boundary="Boundary_(ID_ORCt1LQYbQI4EE4/TPqVUg)" Cc: Subject: S3 state handled in BIOS? X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2005 01:32:56 -0000 --Boundary_(ID_ORCt1LQYbQI4EE4/TPqVUg) Content-type: text/plain; charset=iso-8859-5 Content-transfer-encoding: 8BIT Good people, after much pocking around my laptop (Averatec 3150H), /usr/src/sys/i386/acpica/acpi_wakeup.c and /usr/src/sys/contrib/dev/acpica/hwsleep.c, I came to conclusion that S3 state in my case causes BIOS to suspend machine at the point when SLP_TYP and SLP_EN are set and resume it from that same point, completely ignoring wakeup vector. This would cause FreeBSD to hit infinite loop in acpi_sleep_machdep (acpi_wakeup.c) and never come back. Replacing that loop with AcpiOsSleep(5000) lets system resume properly. This kind of sleep (pseudo S3?) about doubles battery life, which is not much to write home about, but matches what Windows does on the same hardware, so, I guess, it is best I am going to get. Question that I have to the list is whether somebody who knows ACPI thinks that it is common enough situation to warrant tunable along the lines of 'hw.acpi.s3bios', which would eliminate infinite loop if set? I have unconditionally eliminated the loop for now and have been testing it here for awhile without any bad side effects. If your system appears to hang after resume from S3 while turning power on, you might want to try attached very simplistic patch. -- Alexandre "Sunny" Kovalenko (Олександр Коваленко) --Boundary_(ID_ORCt1LQYbQI4EE4/TPqVUg) Content-type: text/x-patch; name=acpi_wakeup.c.patch; charset=ASCII Content-transfer-encoding: 7BIT Content-disposition: attachment; filename=acpi_wakeup.c.patch --- acpi_wakeup.c.ORIG Sun May 22 21:22:42 2005 +++ acpi_wakeup.c Sun May 22 21:25:11 2005 @@ -258,7 +258,8 @@ goto out; } - for (;;) ; + AcpiOsSleep(5000); + intr_resume(); } else { /* Execute Wakeup */ intr_resume(); --Boundary_(ID_ORCt1LQYbQI4EE4/TPqVUg)--