From 1ee15369fecc3f7aab52b6db6b445b600672312e Mon Sep 17 00:00:00 2001 From: njl Date: Fri, 12 Dec 2003 19:42:16 +0000 Subject: 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 --- sys/dev/acpica/acpi_cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev') 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); -- cgit v1.1