svn commit: r236220 - head/sys/dev/acpica
Mitsuru IWASAKI
iwasaki at FreeBSD.org
Tue May 29 05:09:41 UTC 2012
Author: iwasaki
Date: Tue May 29 05:09:40 2012
New Revision: 236220
URL: http://svn.freebsd.org/changeset/base/236220
Log:
Fix the problem acpi_sleep_force() hang.
Suspending from callout cause the freeze in DEVICE_SUSPEND().
Suspend from acpi_task thread in stead.
MFC after: 3 days
Modified:
head/sys/dev/acpica/acpi.c
Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c Tue May 29 04:53:46 2012 (r236219)
+++ head/sys/dev/acpica/acpi.c Tue May 29 05:09:40 2012 (r236220)
@@ -2449,15 +2449,29 @@ acpi_SetSleepState(struct acpi_softc *sc
#if defined(__amd64__) || defined(__i386__)
static void
+acpi_sleep_force_task(void *context)
+{
+ struct acpi_softc *sc = (struct acpi_softc *)context;
+
+ if (ACPI_FAILURE(acpi_EnterSleepState(sc, sc->acpi_next_sstate)))
+ device_printf(sc->acpi_dev, "force sleep state S%d failed\n",
+ sc->acpi_next_sstate);
+}
+
+static void
acpi_sleep_force(void *arg)
{
struct acpi_softc *sc = (struct acpi_softc *)arg;
device_printf(sc->acpi_dev,
"suspend request timed out, forcing sleep now\n");
- if (ACPI_FAILURE(acpi_EnterSleepState(sc, sc->acpi_next_sstate)))
- device_printf(sc->acpi_dev, "force sleep state S%d failed\n",
- sc->acpi_next_sstate);
+ /*
+ * XXX Suspending from callout cause the freeze in DEVICE_SUSPEND().
+ * Suspend from acpi_task thread in stead.
+ */
+ if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER,
+ acpi_sleep_force_task, sc)))
+ device_printf(sc->acpi_dev, "AcpiOsExecute() for sleeping failed\n");
}
#endif
More information about the svn-src-head
mailing list