From owner-freebsd-acpi@FreeBSD.ORG Wed Apr 15 16:08:11 2009 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 0CE0C106566B; Wed, 15 Apr 2009 16:08:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 15 Apr 2009 12:08:02 -0400 User-Agent: KMail/1.6.2 References: <49DB639A.4090504@icyb.net.ua> <200904141424.00943.jkim@FreeBSD.org> <49E5A200.6010306@freebsd.org> In-Reply-To: <49E5A200.6010306@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200904151208.03822.jkim@FreeBSD.org> Cc: freebsd-acpi@freebsd.org Subject: Re: run resume code only for S1-S4 states 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, 15 Apr 2009 16:08:12 -0000 On Wednesday 15 April 2009 04:59 am, Andriy Gapon wrote: > on 14/04/2009 21:23 Jung-uk Kim said the following: > > On Tuesday 14 April 2009 11:58 am, Andriy Gapon wrote: > >> Guys, > >> could you please review the attached patch? > >> > >> Its main idea is to make control flow of acpi_EnterSleepState > >> similar to that of acpi_ReqSleepState: reject invalid state > >> parameter immediately and handle special S5 as early as > >> possible. Primary purpose is to avoid running resume code when > >> it is not necessary - e.g. shutdown_nice() typically returns > >> immediately after initiating a graceful shutdown by sending a > >> signal to init. > > > > I tried to solve this problem once. To preserve the current > > behaviour, you have to clean up sc->acpi_next_sstate and set > > sc->acpi_sstate to S5 as well if my memory serves. > > I am not sure if I understand why/where this could be useful. > S5 is a "terminal" state, so unless shutdown fails for some reason > (can there be any?) this shouldn't matter. Actually, my patch was more complex, e.g., I added more code to make sure power/sleep button events get ignored and cleared when it is not in S0 state, etc. Probably I needed to track the current state because of it. I think you may ignore it for now if it is not needed anywhere else. Thanks, Jung-uk Kim