From owner-freebsd-questions@FreeBSD.ORG Mon Jul 30 15:21:25 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDA691065676; Mon, 30 Jul 2012 15:21:25 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id 4885F8FC14; Mon, 30 Jul 2012 15:21:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id q6UFL65l036994; Tue, 31 Jul 2012 01:21:07 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Tue, 31 Jul 2012 01:21:06 +1000 (EST) From: Ian Smith To: Piotr Czachur In-Reply-To: <20120729120033.23506106568C@hub.freebsd.org> Message-ID: <20120730231933.V37097@sola.nimnet.asn.au> References: <20120729120033.23506106568C@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org Subject: Re: Waking system up from suspend-to-ram at specified time. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2012 15:21:25 -0000 In freebsd-questions Digest, Vol 425, Issue 13, Message: 13 On Sat, 28 Jul 2012 21:37:48 +0200 Piotr Czachur wrote: > Dear users, > > Does FreeBSD support waking system up from S3 (suspend to RAM) state > at specified time? On Linux, it can be achieved using rtcwake command > that uses RTC support in kernel. Not yet, unless I've missed something since 2010 (not impossible :) > If it's not supported, maybe I can somehow enable waking from S3 using > BIOS autoresume option? It powers my box on from complete off, but > fails to wake it up from S3. What works for now is waking from S3 > using Wake-on-LAN. > > Cheers, > Piotrek On my Thinkpad T23, BIOS autostart (not autoresume) time setting also works only from a cold start. WoL also worked from 'off' but not from S3, but that was on 8.1-STABLE. What version are you running, and on what machine? Some reports indicate success may depend on which BIOS. I'll forward you offlist a couple of never-completed drafts that turned up in postponed messages from 2010 while hunting mail about this, to (bcc'd) avg@, brucec@ and mav@, after researching this in response to an ACPI PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern%2F73823&cat= Then at least, you also had to modify Linux shutdown behaviour to avoid writing the clocktime back to the RTC if a wake time had been set, as RTC writes did not preserve the RTC wake interrupt bit, for some reason. FreeBSD also does not preserve (gratuitously zeroes) that bit on all RTC writes, which is easily enough fixable, mostly in writertc.c, with few other places needing mods that I could see. Ah yes, plus a (cleanroom) utility not unlike rtcwake, but once writertc() is fixed that should be relatively trivial, without needing to mess with the shutdown code. Present circumstances don't permit me to work on this further, but I do think it could be a worthwhile and not so hard project for 'someone' :) cheers, Ian