From owner-svn-src-all@FreeBSD.ORG Wed May 23 14:44:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55579106566B; Wed, 23 May 2012 14:44:58 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FA138FC14; Wed, 23 May 2012 14:44:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4NEiwai078387; Wed, 23 May 2012 14:44:58 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4NEiwbx078385; Wed, 23 May 2012 14:44:58 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205231444.q4NEiwbx078385@svn.freebsd.org> From: Mitsuru IWASAKI Date: Wed, 23 May 2012 14:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235835 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2012 14:44:58 -0000 Author: iwasaki Date: Wed May 23 14:44:57 2012 New Revision: 235835 URL: http://svn.freebsd.org/changeset/base/235835 Log: MFC 235692,235772: - Don't start the sleep state transition procedure while sleep is disabled or the system is in shutdown procedure. - Ignore the power button press event for resuming rather than starting shutdown. Modified: stable/9/sys/dev/acpica/acpi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Wed May 23 13:45:52 2012 (r235834) +++ stable/9/sys/dev/acpica/acpi.c Wed May 23 14:44:57 2012 (r235835) @@ -2468,14 +2468,20 @@ acpi_ReqSleepState(struct acpi_softc *sc if (!acpi_sleep_states[state]) return (EOPNOTSUPP); - ACPI_LOCK(acpi); - /* If a suspend request is already in progress, just return. */ if (sc->acpi_next_sstate != 0) { - ACPI_UNLOCK(acpi); return (0); } + /* Wait until sleep is enabled. */ + while (sc->acpi_sleep_disabled) { + AcpiOsSleep(1000); + } + + ACPI_LOCK(acpi); + + sc->acpi_next_sstate = state; + /* S5 (soft-off) should be entered directly with no waiting. */ if (state == ACPI_STATE_S5) { ACPI_UNLOCK(acpi); @@ -2484,7 +2490,6 @@ acpi_ReqSleepState(struct acpi_softc *sc } /* Record the pending state and notify all apm devices. */ - sc->acpi_next_sstate = state; STAILQ_FOREACH(clone, &sc->apm_cdevs, entries) { clone->notify_status = APM_EV_NONE; if ((clone->flags & ACPI_EVF_DEVD) == 0) {