From owner-freebsd-acpi@FreeBSD.ORG Fri Jan 20 19:52:25 2006 Return-Path: X-Original-To: freebsd-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 3E84916A420 for ; Fri, 20 Jan 2006 19:52:25 +0000 (GMT) (envelope-from nate@root.org) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B5A043D5C for ; Fri, 20 Jan 2006 19:52:24 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.53] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id k0KJqJVK028072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Jan 2006 11:52:20 -0800 Message-ID: <43D13F8A.8000802@root.org> Date: Fri, 20 Jan 2006 11:52:42 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Manfred Lotz References: <20060120200410.a05870c1.manfred.lotz@arcor.de> In-Reply-To: <20060120200410.a05870c1.manfred.lotz@arcor.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org Subject: Re: suspend/resume event 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: Fri, 20 Jan 2006 19:52:25 -0000 Manfred Lotz wrote: > Hi there, > With my Samsung X20 1730 suspend /resume works fine when doing > acpiconf -s 3. I added /etc/rc.d/moused restart in /etc/rc.resume and > the touchpad mouse gets awake after resuming. That's great. > > However when closing the lid (I set hw.acpi.lid_switch_state=S3) and > then pressing the power button although suspend/resume works > fine the mouse won't get restarted. This means /etc/rc.resume and > presumably /etc/rc.suspend won't get called in this case. > > Same happen when pressing Fn-ESC the key for suspend. > > How can I make sure /etc/rc.suspend as well as /etc/rc.resuem gets > called in the "non-acpiconf" cases? That's an implementation problem. I think the right approach is to add a resume notification to devd. That should be easy to do and I may look into it this weekend if no one submits a patch first. It's harder to hook in the suspend path because we'd have to add a new path: kernel notifies userland, waits for userland to complete rc.suspend, userland sends "go ahead" to kernel, and suspend actually happens. apm had that but there's a problem if userland is not responsive. The idea I came up with was to have an absolute timeout where after 30 seconds or something, the kernel gives up on userland and suspends anyway. I started work on a patch to do this a while ago but it had some bugs I never got around to fixing. One problem was multiple listeners (X11 server, rc.suspend, etc.) -- do you wait for all of them to ack the event before suspending? I think so, but it's difficult to get all the cases right. If someone wants to help finish this work, I'd be happy to supply the half-done patch. -- Nate