aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2012-12-01 18:06:05 +0000
committerAndriy Gapon <avg@FreeBSD.org>2012-12-01 18:06:05 +0000
commit30bf6110b5c6bb53e22fa3c0c85acc7deb49c950 (patch)
treeff095c85e89b791f3f8a61f33bbcf58eb51098e5 /sys/dev/acpica
parent09424d43c179c50ef58928cadc967e1ac5200377 (diff)
Notes
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_cpu.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index 7e3a3e7c26d6..7f008f72df6b 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -973,9 +973,9 @@ acpi_cpu_idle()
return;
}
- /* If disabled, return immediately. */
+ /* If disabled, take the safe path. */
if (is_idle_disabled(sc)) {
- ACPI_ENABLE_IRQS();
+ acpi_cpu_c1();
return;
}
@@ -1081,23 +1081,31 @@ acpi_cpu_idle()
/*
* Re-evaluate the _CST object when we are notified that it changed.
- *
- * XXX Re-evaluation disabled until locking is done.
*/
static void
acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context)
{
struct acpi_cpu_softc *sc = (struct acpi_cpu_softc *)context;
-
+
if (notify != ACPI_NOTIFY_CX_STATES)
return;
+ /*
+ * C-state data for target CPU is going to be in flux while we execute
+ * acpi_cpu_cx_cst, so disable entering acpi_cpu_idle.
+ * Also, it may happen that multiple ACPI taskqueues may concurrently
+ * execute notifications for the same CPU. ACPI_SERIAL is used to
+ * protect against that.
+ */
+ ACPI_SERIAL_BEGIN(cpu);
+ disable_idle(sc);
+
/* Update the list of Cx states. */
acpi_cpu_cx_cst(sc);
acpi_cpu_cx_list(sc);
-
- ACPI_SERIAL_BEGIN(cpu);
acpi_cpu_set_cx_lowest(sc);
+
+ enable_idle(sc);
ACPI_SERIAL_END(cpu);
acpi_UserNotify("PROCESSOR", sc->cpu_handle, notify);