Date: Thu, 21 Jun 2007 17:50:44 +0200 From: Lars Engels <lars.engels@0x20.net> To: Nate Lawson <nate@root.org> Cc: acpi@freebsd.org, arch@freebsd.org, current <current@freebsd.org> Subject: Re: patch: acpi usermode suspend API change Message-ID: <20070621155044.GD17194@e.0x20.net> In-Reply-To: <46756BBE.5030603@root.org> References: <46756BBE.5030603@root.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070621155044.GD17194>