From: Dominik B. <de...@br...> - 2002-03-12 10:13:21
|
Hi! Finally I found the bug which disables throttling with any PIIX4 chipset. The current code overwrites seemingly unused P_CNT bits with zero. This causes some flags in the PIIX4/PIIX4E/PIIX4M chipsets to be un-set, especially the CC_EN flag which enables all processor power management. This patch resolves these issues. Changes: x read u32 integers as we write u32 integers x make duty_mask work again Oh, and one further comment: Dave Jones' Mhz-detection tool still returns the CPU's core frequency, even though throttling does work now. Dominik --- linux/drivers/acpi/acpi_processor.c.orig Tue Mar 12 09:05:14 2002 +++ linux/drivers/acpi/acpi_processor.c Tue Mar 12 10:37:23 2002 @@ -778,7 +778,7 @@ duty_mask = pr->throttling.state_count - 1; duty_mask <<= pr->throttling.duty_offset; - value = inb(pr->throttling.address); + value = inl(pr->throttling.address); /* * Compute the current throttling state when throttling is enabled @@ -847,7 +847,7 @@ duty_value <<= pr->throttling.duty_offset; /* Used to clear all duty_value bits */ - duty_mask = pr->performance.state_count - 1; + duty_mask = pr->throttling.state_count - 1; duty_mask <<= acpi_fadt.duty_offset; duty_mask = ~duty_mask; } @@ -856,7 +856,7 @@ * Disable throttling by writing a 0 to bit 4. Note that we must * turn it off before you can change the duty_value. */ - value = inb(pr->throttling.address); + value = inl(pr->throttling.address); if (value & 0x10) { value &= 0xFFFFFFEF; outl(value, pr->throttling.address); |