svn commit: r247883 - stable/9/sys/dev/acpica

Andriy Gapon avg at FreeBSD.org
Wed Mar 6 10:45:46 UTC 2013


Author: avg
Date: Wed Mar  6 10:45:46 2013
New Revision: 247883
URL: http://svnweb.freebsd.org/changeset/base/247883

Log:
  MFC r246250,246252: acpi: after wakeup from a state > S1 re-enable
  SCI_EN with a direct write

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 Mar  6 10:40:50 2013	(r247882)
+++ stable/9/sys/dev/acpica/acpi.c	Wed Mar  6 10:45:46 2013	(r247883)
@@ -2742,6 +2742,19 @@ acpi_EnterSleepState(struct acpi_softc *
     if (state != ACPI_STATE_S1) {
 	sleep_result = acpi_sleep_machdep(sc, state);
 	acpi_wakeup_machdep(sc, state, sleep_result, 0);
+
+	/*
+	 * XXX According to ACPI specification SCI_EN bit should be restored
+	 * by ACPI platform (BIOS, firmware) to its pre-sleep state.
+	 * Unfortunately some BIOSes fail to do that and that leads to
+	 * unexpected and serious consequences during wake up like a system
+	 * getting stuck in SMI handlers.
+	 * This hack is picked up from Linux, which claims that it follows
+	 * Windows behavior.
+	 */
+	if (sleep_result == 1 && state != ACPI_STATE_S4)
+	    AcpiWriteBitRegister(ACPI_BITREG_SCI_ENABLE, ACPI_ENABLE_EVENT);
+
 	intr_restore(intr);
 
 	/* call acpi_wakeup_machdep() again with interrupt enabled */


More information about the svn-src-all mailing list