summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2003-12-12 19:42:16 +0000
committernjl <njl@FreeBSD.org>2003-12-12 19:42:16 +0000
commit1ee15369fecc3f7aab52b6db6b445b600672312e (patch)
tree41d5ca60c437e2dcca6b76a87e42efff3a43ccb3 /sys/dev/acpica
parentd2a6451a37922152b78305f66308dedace8bb5ba (diff)
downloadFreeBSD-src-1ee15369fecc3f7aab52b6db6b445b600672312e.zip
FreeBSD-src-1ee15369fecc3f7aab52b6db6b445b600672312e.tar.gz
Fix throttling to use the proper mask. The bug resulted in only two
throttling values being available regardless of the CPU's capabilities. This has been broken since rev 1.1. Also clarify a comment. Submitted by: Taku YAMAMATO <taku@cent.saitama-u.ac.jp>
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_cpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index 638dd27..92e1f7c 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -94,7 +94,7 @@ struct acpi_cpu_softc {
rman_get_bushandle((reg)), 0, (val)))
/*
- * Speeds are stored in counts, from 1 - CPU_MAX_SPEED, and
+ * Speeds are stored in counts, from 1 to CPU_MAX_SPEED, and
* reported to the user in tenths of a percent.
*/
static uint32_t cpu_duty_offset;
@@ -775,7 +775,7 @@ acpi_cpu_throttle_set(uint32_t speed)
/* If we're at maximum speed, that's all */
if (speed < CPU_MAX_SPEED) {
/* Mask the old CLK_VAL off and or-in the new value */
- clk_val = CPU_MAX_SPEED << cpu_duty_offset;
+ clk_val = (CPU_MAX_SPEED - 1) << cpu_duty_offset;
p_cnt &= ~clk_val;
p_cnt |= (speed << cpu_duty_offset);
OpenPOWER on IntegriCloud