Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2012 14:44:57 +0000 (UTC)
From:      Mitsuru IWASAKI <iwasaki@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r235835 - stable/9/sys/dev/acpica
Message-ID:  <201205231444.q4NEiwbx078385@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205231444.q4NEiwbx078385>