From owner-freebsd-acpi@FreeBSD.ORG Wed Apr 9 12:43:23 2008 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F228F10656C0 for ; Wed, 9 Apr 2008 12:43:23 +0000 (UTC) (envelope-from iwasaki@jp.FreeBSD.org) Received: from locore.org (ns01.locore.org [218.45.21.227]) by mx1.freebsd.org (Postfix) with ESMTP id AB7808FC30 for ; Wed, 9 Apr 2008 12:43:23 +0000 (UTC) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (celeron.v4.locore.org [192.168.0.10]) by locore.org (8.14.2/8.14.2/iwasaki) with ESMTP/inet id m39ChKSj020268; Wed, 9 Apr 2008 21:43:20 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Wed, 09 Apr 2008 21:43:18 +0900 (JST) Message-Id: <20080409.214318.132031270.iwasaki@jp.FreeBSD.org> To: mickey242@gmx.net From: Mitsuru IWASAKI In-Reply-To: <47F8B038.7000400@gmx.net> References: <47F8B038.7000400@gmx.net> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org Subject: Re: FreeBSD 7.0 suspend 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: Wed, 09 Apr 2008 12:43:24 -0000 Hi, From: Andreas Wetzel Subject: FreeBSD 7.0 suspend Date: Sun, 06 Apr 2008 13:12:56 +0200 Message-ID: <47F8B038.7000400@gmx.net> > /* If devd(8) is not running, immediately enter the sleep state. */ > if (devctl_process_running() == FALSE) { > ... > > For some reason this check returns FALSE, although devd is actually running. > When i comment out the check, everything works as expected: devd is notified, > executes /etc/rc.suspend, which in turn calls acpiconf -k 0 when done, and > then the system goes to sleep. > > Any ideas, why this function does not correctly recognize that devd is > running? Please try the following patches and see if the problem is solved. Thanks! Index: subr_bus.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_bus.c,v retrieving revision 1.201.2.1 diff -u -r1.201.2.1 subr_bus.c --- subr_bus.c 6 Feb 2008 01:34:18 -0000 1.201.2.1 +++ subr_bus.c 9 Apr 2008 12:30:30 -0000 @@ -504,7 +504,7 @@ boolean_t devctl_process_running(void) { - return (devsoftc.async_proc != NULL); + return (devsoftc.inuse == 1) } /**