amd76x_pm: C2 powersaving for AMD K7
Subsystems (2)
PATCH 1/1 amd76x_pm: C2 powersaving for AMD K7
This is a processor idle module for AMD SMP 760MP(X) based systems. The patch was originally written by Tony Lindgren and has been around since 2002. It enables C2 mode on AMD SMP systems and thus saves about 70 - 90 W of energy in the idle mode compared to the default idle mode. The idle function has been rewritten and now should be free of locking issues and is independent from the number of CPUs. The impact from this module on the system clock has been reduced.
This patch can also be found at
http://www.sommrey.de/amd76x_pm/amd_76x_pm-2.6.12-jo1.patch
Documentation/amd76x_pm.txt +97 -0
@@ -0,0 +1,97 @@ + ACPI style power management for SMP AMD-760MP(X) based systems + ============================================================== + +For use until the ACPI project catches up. :-) + +Using this module saves about 70 - 90W of energy in the idle mode compared +to the default idle mode. Waking up from the idle mode is fast to keep the +system response time good. Currently no CPU load calculation is done, the +system exits the idle mode if there is a CPU that isn't idle. + +NOTE: Currently there's a bug somewhere where the reading the + P_LVL2 for the first time causes the system to sleep instead of + idling. This means that you need to hit the power button once to + wake the system after loading the module for the first time after + reboot. After that the system idles as supposed. + (Only observed on Tony's system.) + + +Influenced by Vcool, and LVCool. Rewrote everything from scratch to +use the PCI features in Linux, and to support SMP systems. + +Currently tested amongst others on a TYAN S2460 (760MP) system (Tony), an +ASUS A7M266-D (760MPX) system (Johnathan) and a TYAN S2466 (760MPX) +system (Jo). Adding support for other Athlon SMP or single processor +systems should be easy if desired. + +You'll find some files in /sys/devices/pci0000:00/0000:00:00.0/ +lazy_idle (rw) see below +C2_cnt (ro) the number of C2 calls + +There is a tunable lazy_idle parameter that defines the number of idle +calls before C2 mode is entered. Higher values give better system +response and lower values give better cooling. This value has an +influence on the system clock stability too: If the system clock is +synchronized via ntpd you may watch lower values for the frequency if +the module is loaded. If this happens then the system clock speed +depends on the system load: higher load, less idle calls, higher +frequency. Play around with this parameter and try to find a value that +gives acceptable cooling and clock stability. This parameter can be set +as a module parameter to amd76x_pm or via the writable sysfs file +lazy_idle (see above). Feel free to play around with this parameter to +find out which fits best for you. The default value of 512 might be not +suitable for your needs but is a good starting point. + +This software is licensed under GNU General Public License Version 2 +as specified in file COPYING in the Linux kernel source tree main +directory. + +Copyright (C) 2002 - 2005 Johnathan Hicks <[email protected]> + Tony Lindgren <[email protected]> + Joerg Sommrey <[email protected]> + +History: + + 20020702 - amd-smp-idle: Tony Lindgren <[email protected]> +Influenced by Vcool, and LVCool. Rewrote everything from scratch to +use the PCI features in Linux, and to support SMP systems. Provides +C2 idling on SMP AMD-760MP systems. + + 20020722: JH + I adapted Tony's code for the AMD-765/766 southbridge and adapted it + according to the AMD-768 data sheet to provide the same capability for + SMP AMD-760MPX systems. Posted to acpi-devel list. + + 20020722: Alan Cox + Replaces non-functional amd76x_pm code in -ac tree. + + 20020730: JH + Added ability to do normal throttling (the non-thermal kind), C3 idling + and Power On Suspend (S1 sleep). It would be very easy to tie swsusp + into activate_amd76x_SLP(). C3 idling doesn't happen yet; see my note + in amd76x_smp_idle(). I've noticed that when NTH and idling are both + enabled, my hardware locks and requires a hard reset, so I have + #ifndefed around the idle loop setting to prevent this. POS locks it up + too, both ought to be fixable. I've also noticed that idling and NTH + make some interference that is picked up by the onboard sound chip on + my ASUS A7M266-D motherboard. + + 20030601: Pasi Savolainen + Simple port to 2.5 + Added sysfs interface for making nice graphs with mrtg. + Look for /sys/devices/pci0/00:00.0/C2_cnt & lazy_idle (latter writable) + + 20050601: Joerg Sommrey (jo) + 2.6 stuff + redesigned amd76x_smp_idle. The algorithm is basically the same + but the implementation has changed. This part is now independent + from the number of CPUs and data is locked against concurrent + updates from different CPUs. + use _smp_processor_id() + use cpu_idle_wait() + NTH and POS code not touched and not tested. + +TODO: Thermal throttling (TTH). + /proc interface for normal throttling level. + /proc interface for POS. +
drivers/acpi/Kconfig +14 -0
@@ -352,4 +352,18 @@ $>modprobe acpi_memhotplug endif # ACPI +config AMD76X_PM + tristate "AMD76x Native Power Management support" + default n + depends on X86 && PCI + ---help--- + This driver enables Power Management on AMD760MP & AMD760MPX chipsets. This is about same as ACPI C2, except that ACPI folks don't do SMP ATM. + See Documentation/amd76x_pm.txt for further details. + + To compile this driver as a module ( = code which can be inserted in + and removed from the running kernel whenever you want), say M + here. The module will be called amd76x_pm. + + If unsure, say N. + endmenu
drivers/acpi/Makefile +5 -0
@@ -56,3 +56,8 @@ obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o obj-$(CONFIG_ACPI_BUS) += scan.o motherboard.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o + +# +# not really ACPI thing, until they handle SMP. +# +obj-$(CONFIG_AMD76X_PM) += amd76x_pm.o
drivers/acpi/amd76x_pm.c +862 -0
862 lines not on this page · raw message
include/linux/amd76x_pm.h +59 -0
59 lines not on this page · raw message
Quoted 10 lines · Joerg Sommrey
This is a processor idle module for AMD SMP 760MP(X) based systems. The patch was originally written by Tony Lindgren and has been around since 2002. It enables C2 mode on AMD SMP systems and thus saves about 70 - 90 W of energy in the idle mode compared to the default idle mode. The idle function has been rewritten and now should be free of locking issues and is independent from the number of CPUs. The impact from this module on the system clock has been reduced.
This patch can also be found at
http://www.sommrey.de/amd76x_pm/amd_76x_pm-2.6.12-jo1.patch
Cool. Just once comment:
drivers/acpi/amd76x_pm.c line 110
Quoted 3 lines
drivers/acpi/amd76x_pm.c +3
-0+// #define AMD76X_NTH 1 +// #define AMD76X_POS 1 +// #define AMD76X_C3 1
How about separating all this ifdef code into a separate debug patch on top of the amd_76x_pm patch? Or just leave it out as I don't think anybody is using it. It would shrink down the patch quite a bit and make it more readable.
I won't be able to access my dual athlon box until September, so I'm not much of help with this module :)
Regards,
Tony
Quoted 23 lines · Tony Lindgren
Quoted 10 lines · Joerg Sommrey
This is a processor idle module for AMD SMP 760MP(X) based systems. The patch was originally written by Tony Lindgren and has been around since 2002. It enables C2 mode on AMD SMP systems and thus saves about 70 - 90 W of energy in the idle mode compared to the default idle mode. The idle function has been rewritten and now should be free of locking issues and is independent from the number of CPUs. The impact from this module on the system clock has been reduced.
This patch can also be found at
http://www.sommrey.de/amd76x_pm/amd_76x_pm-2.6.12-jo1.patchCool. Just once comment:
drivers/acpi/amd76x_pm.c line 110
Quoted 3 lines
drivers/acpi/amd76x_pm.c +3
-0+// #define AMD76X_NTH 1 +// #define AMD76X_POS 1 +// #define AMD76X_C3 1 How about separating all this ifdef code into a separate debug patch on top of the
amd_76x_pmpatch? Or just leave it out as I don't think anybody is using it. It would shrink down the patch quite a bit and make it more readable.
Quoted 7 lines
I won't be able to access my dual athlon box until September, so I'm not much of help with this module :)
Regards,
Tony
I have been running with the 2.6.11-jo3 patch since Joerg made it available. It works fine on my ASUS A7M266-D with two Athlon MP1800+ that is running 24h. I just patched 2.6.12 vanilla kernel and it looks good. I will report if there are any issues.
regards,
Johan
Quoted 5 lines · On Wed, Jun 22, 2005 at 07:33:32PM +0300, [email protected] wrote:
I have been running with the 2.6.11-jo3 patch since Joerg made it available. It works fine on my ASUS A7M266-D with two Athlon MP1800+ that is running 24h. I just patched 2.6.12 vanilla kernel and it looks good. I will report if there are any issues.
If you experience any different behaviour between 2.6.11-jo3 and 2.6.12-jo1 I really would like to hear about that. There are major differences between those two versions.
-jo
Signature · 1 line
-rw-r--r-- 1 jo users 63 2005-06-21 20:36 /home/jo/.signature