From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 16:13:04 2007 Return-Path: X-Original-To: acpi@freebsd.org Delivered-To: freebsd-acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3226216A469; Thu, 21 Jun 2007 16:13:04 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.67.217]) by mx1.freebsd.org (Postfix) with ESMTP id 0FCFC13C468; Thu, 21 Jun 2007 16:13:03 +0000 (UTC) (envelope-from lars@e.0x20.net) Received: by mail.0x20.net (Postfix, from userid 1002) id D48F739E28; Thu, 21 Jun 2007 17:50:44 +0200 (CEST) Date: Thu, 21 Jun 2007 17:50:44 +0200 From: Lars Engels To: Nate Lawson Message-ID: <20070621155044.GD17194@e.0x20.net> References: <46756BBE.5030603@root.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IrhDeMKUP4DT/M7F" Content-Disposition: inline In-Reply-To: <46756BBE.5030603@root.org> X-Editor: VIM - Vi IMproved 7.0 X-Operation-System: FreeBSD 5.5-RELEASE User-Agent: mutt-ng/devel-r804 (FreeBSD) Cc: acpi@freebsd.org, arch@freebsd.org, current Subject: Re: patch: acpi usermode suspend API change 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: Thu, 21 Jun 2007 16:13:04 -0000 --IrhDeMKUP4DT/M7F Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 17, 2007 at 10:13:34AM -0700, Nate Lawson wrote: > This patch updates the user API for acpi suspend in a number of ways. >=20 > * /etc/rc.suspend,rc.resume are always run, no matter the source of the > suspend event > * suspend now requires positive user acknowledgement. If a user program > wants to cancel the suspend, they can. If one of the user programs > hangs or doesn't respond within 10 seconds, the system suspends anyway. > * /dev/apm is clonable, allowing multiple listeners for suspend events. > In the future, xorg-server can use this to be informed about suspend > even if there are other listeners (i.e. apmd). >=20 > The API changes are intended to be MFCd and hence are minimal. >=20 > * Two new ACPI ioctls: REQSLPSTATE and ACKSLPSTATE. Request begins the > process of suspending by notifying all listeners. acpi is monitored by > devd(8) and /dev/apm listener(s) are also counted. Users register their > approval or disapproval via Ack. If anyone disapproves, suspend is vetoe= d. >=20 > * Binary compat is preserved in that old user programs or kernel modules > (yeah, right) that called the API can still do so. A message is printed > once that this interface is deprecated. >=20 > * acpiconf gains the -k flag to ack the suspend request. This flag is > undocumented on purpose since it's only used by /etc/rc.suspend. It is > not intended to be a permanent change and will be removed once a better > power API is implemented. >=20 > These patches have been successfully tested for about a week through > suspend/resumes and various usermode programs, including patches to > xorg-server. >=20 > The eventual goal is to improve subr_power to be a more generic central > power management interface to user and kernel providers. powerd(8) > might start managing profiles similar to apmd(8). I don't know yet and > there isn't time to do that. This patch provides a reasonable interface > for now and eliminates some serious weaknesses, especially in that > pressing a sleep button did not guarantee rc.suspend would run before > sleeping. >=20 > Comments welcome, patches are for 6.x and 7.x. >=20 > --=20 > Nate Nate,=20 thanks for your patch.=20 But after applying it on a recent -Current I get a lot of kernel messages like these: Jun 21 17:48:27 maggie kernel: apm34 opened clone 0xc457fd00 Jun 21 17:48:27 maggie kernel: apm34 closed clone 0xc457fd00 Jun 21 17:48:32 maggie kernel: apm35 opened clone 0xc457ee40 Jun 21 17:48:32 maggie kernel: apm35 closed clone 0xc457ee40 Jun 21 17:48:37 maggie kernel: apm36 opened clone 0xc457ec40 Jun 21 17:48:37 maggie kernel: apm36 closed clone 0xc457ec40 Jun 21 17:48:42 maggie kernel: apm37 opened clone 0xc457fc40 Jun 21 17:48:42 maggie kernel: apm37 closed clone 0xc457fc40 Jun 21 17:48:47 maggie kernel: apm38 opened clone 0xc433b6c0 Jun 21 17:48:47 maggie kernel: apm38 closed clone 0xc433b6c0 Jun 21 17:48:52 maggie kernel: apm39 opened clone 0xc433b240 Additionally, pressing the power button only generates this: Jun 21 17:50:03 maggie kernel: acpi: request to enter state S5 failed I need to run 'shutdown -p ' to power the system down. Lars --IrhDeMKUP4DT/M7F Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGep5UKc512sD3afgRAuIOAKCe7fX+8Rq9yxYfyHEr7zpc8DIgGQCfQx1h IQDhkaFIK/F19KqAjJzz5LA= =KqZc -----END PGP SIGNATURE----- --IrhDeMKUP4DT/M7F--