From owner-freebsd-acpi@freebsd.org Wed Sep 23 00:23:27 2015 Return-Path: Delivered-To: freebsd-acpi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7FB7A07C56 for ; Wed, 23 Sep 2015 00:23:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 858061470; Wed, 23 Sep 2015 00:23:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CB1B4B97B; Tue, 22 Sep 2015 20:23:25 -0400 (EDT) From: John Baldwin To: freebsd-acpi@freebsd.org Cc: Jung-uk Kim , Colin Percival , Anthony Jenkins Subject: Re: disabling sleep when shutting down Date: Tue, 22 Sep 2015 15:38:39 -0700 Message-ID: <1905488.VHUbJhcB3l@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <5601A863.5070406@FreeBSD.org> References: <55FA3848.7090802@freebsd.org> <55FE5D54.1030806@freebsd.org> <5601A863.5070406@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Sep 2015 20:23:25 -0400 (EDT) X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2015 00:23:27 -0000 On Tuesday, September 22, 2015 03:13:39 PM Jung-uk Kim wrote: > > On 09/20/2015 03:16, Colin Percival wrote: > >> On 09/18/15 11:29, Anthony Jenkins wrote: > >>> Is it possible for /etc/rc.shutdown to complete, but shutdown > >>> not occur? If so, there should be a mechanism to restore the > >>> ability to suspend. Other than that, I like it. > >> > >> Hmm... well, rc.shutdown runs before the system drops into > >> single-user mode. Which makes me think that maybe we should be > >> making the kernel call from inside init instead of from > >> rc.shutdown. > > > > I didn't want to pollute init with arch-dependent hacks. Anyway, > > the attached patch should do what you want (not tested). > > Or a simpler hack with sysctl(3) instead of ioctl(2). I kind of think just setting the LID switch sysctl during shutdown is probably fine. That said, if you want to do this in the kernel, there's no reason to make this x86-specific. powerpc laptops can suspend but don't use ACPI to do so. Can you just have an MI sysctl that init frobs? It doesn't hurt to do so on platforms that don't support suspending (the knob would just be a no-op). -- John Baldwin