aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-06-23 17:51:11 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-06-23 17:51:11 +0000
commitb6bfb5a01f03ba4c209585c216a45ae976d81c63 (patch)
tree2f3a90267b701f04821cebc21711d536fdeeab89
parent3aaef367db9985f28984701ddc059dcfbae7d945 (diff)
downloadsrc-b6bfb5a01f03ba4c209585c216a45ae976d81c63.tar.gz
src-b6bfb5a01f03ba4c209585c216a45ae976d81c63.zip
MFC 209213:
When updating individual CPU's lowest Cx state to use, never set it to a state lower than the lowest one supported by the current CPU. This closes some races with changes to the hw.acpi.cpu_cx_lowest sysctl while Cx states for individual CPUs were changing (e.g. unplugging the AC adapter of a laptop) that could result in panics. Approved by: re (kib)
Notes
Notes: svn path=/releng/8.1/; revision=209473
-rw-r--r--sys/dev/acpica/acpi_cpu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index 06c295481322..1483eae61cc8 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -1009,6 +1009,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context)
if (isc->cpu_cx_count > cpu_cx_count)
cpu_cx_count = isc->cpu_cx_count;
}
+ if (sc->cpu_cx_lowest < cpu_cx_lowest)
+ acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1));
ACPI_SERIAL_END(cpu);
}
@@ -1204,7 +1206,7 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS)
ACPI_SERIAL_BEGIN(cpu);
for (i = 0; i < cpu_ndevices; i++) {
sc = device_get_softc(cpu_devices[i]);
- acpi_cpu_set_cx_lowest(sc, val);
+ acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1));
}
ACPI_SERIAL_END(cpu);