2003-03-12 16:55:55

by Christopher Meredith

[permalink] [raw]
Subject: PowerNow!, cpufreq, and swsusp

Just compiled the 2.5.63 kernel with the intention of
getting support for certain features of my laptop. I;ve got
a Mobile Athlon XP 1800+ w/ PowerNow! technology and was
hoping to use it, as well as be able to "hibernate" the
machine.

>From .config:

#
# Power management options (ACPI, APM)
#
CONFIG_PM=y
CONFIG_SOFTWARE_SUSPEND=y

#
# ACPI Support
#
CONFIG_ACPI=y
# CONFIG_ACPI_HT_ONLY is not set
CONFIG_ACPI_BOOT=y
# CONFIG_ACPI_SLEEP is not set
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_TOSHIBA is not set
CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_BUS=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
CONFIG_ACPI_SYSTEM=y
CONFIG_APM=m
# CONFIG_APM_IGNORE_USER_SUSPEND is not set
# CONFIG_APM_DO_ENABLE is not set
# CONFIG_APM_CPU_IDLE is not set
# CONFIG_APM_DISPLAY_BLANK is not set
# CONFIG_APM_RTC_IS_GMT is not set
# CONFIG_APM_ALLOW_INTS is not set
# CONFIG_APM_REAL_MODE_POWER_OFF is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
# CONFIG_CPU_FREQ_PROC_INTF is not set
# CONFIG_CPU_FREQ_24_API is not set
CONFIG_CPU_FREQ_TABLE=y

#
# CPUFreq processor drivers
#
# CONFIG_X86_ACPI_CPUFREQ is not set
# CONFIG_X86_POWERNOW_K6 is not set
CONFIG_X86_POWERNOW_K7=y
# CONFIG_X86_GX_SUSPMOD is not set
# CONFIG_X86_SPEEDSTEP is not set
# CONFIG_X86_P4_CLOCKMOD is not set
# CONFIG_X86_LONGRUN is not set
# CONFIG_X86_LONGHAUL is not set


And from /var/log/messages:

Mar 11 00:55:49 Judea kernel: powernow: AMD K7 CPU detected.
Mar 11 00:55:49 Judea kernel: powernow: PowerNOW! Technology
present. Can scale: frequency and voltage.
Mar 11 00:55:49 Judea kernel: powernow: Found PSB header at
c00f1920
Mar 11 00:55:49 Judea kernel: powernow: Table version: 0x12
Mar 11 00:55:49 Judea kernel: powernow: Flags: 0x0 (Mobile
voltage regulator)
Mar 11 00:55:49 Judea kernel: powernow: Settling Time: 100
microseconds.
Mar 11 00:55:50 Judea kernel: powernow: Has 14 PST tables.
(Only dumping ones relevant to this CPU).
Mar 11 00:55:50 Judea kernel: powernow: PST:4 (@c00f1978)
Mar 11 00:55:50 Judea kernel: powernow: cpuid: 0x780^Ifsb:
133^ImaxFID: 0x1^Istartvid: 0x9
Mar 11 00:55:50 Judea kernel: powernow: FID: 0x4 (5.0x
[665MHz])^IVID: 0x13 (1.200V)
Mar 11 00:55:50 Judea kernel: powernow: FID: 0x6 (6.0x
[798MHz])^IVID: 0x13 (1.200V)
Mar 11 00:55:50 Judea kernel: powernow: FID: 0xa (8.0x
[1064MHz])^IVID: 0x13 (1.200V)
Mar 11 00:55:50 Judea kernel: powernow: FID: 0xe (10.0x
[1330MHz])^IVID: 0xb (1.450V)
Mar 11 00:55:50 Judea kernel: powernow: FID: 0x1 (11.5x
[1529MHz])^IVID: 0x9 (1.550V)
Mar 11 00:55:50 Judea kernel: powernow: Minimum speed 665
MHz. Maximum speed 1529 MHz.


>From /etc/lilo.conf:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
append="hdc=ide-scsi, resume=/dev/hda3"
boot = /dev/hda
compact # faster, but won't work on all systems.
prompt


When I boot, I get a message that no resume image was found
(which is fine) and it boots normally. However, the
documentation for swsusp says the following:
"You need to append resume=/dev/your_swap_partition to
kernel command line. Then you suspend by echo 4 >
/proc/acpi/sleep."

As shown above, that line has been entered into lilo.conf,
however, /proc/acpi/sleep does not exist. What is the
problem here?

Also, cpufreq doesn't seem to do anything. Should it be
working automatically? Even when the machine sits unattended
for over 8 hours, the fan never turns off and the cpu
temperature is consustently 69-70 degrees C. What must I do
here? Thanks for your help!

~Christopher


---------------------------------------
Use SaintMail! - http://www.saintmail.net


2003-03-12 17:32:02

by Dave Jones

[permalink] [raw]
Subject: Re: PowerNow!, cpufreq, and swsusp

On Wed, Mar 12, 2003 at 12:06:33PM -0500, Christopher Meredith wrote:

> Also, cpufreq doesn't seem to do anything. Should it be
> working automatically?

no.

> Even when the machine sits unattended
> for over 8 hours, the fan never turns off and the cpu
> temperature is consustently 69-70 degrees C.

The kernel doesn't define policy, but exposes the necessary
interface to userspace. There are a few folks working on
tools / scripts to adjust the speed dynamically.
look through the cpufreq mailing list archives to find them
(or google)

> What must I do here?

Read Documentation/cpu-freq/user-guide.txt

short: mount sysfs, and ..

(root@evo:cpufreq)# cd /sys/class/cpu/cpufreq/cpu0/cpufreq
(root@evo:cpufreq)# cat /proc/cpuinfo | grep MHz
cpu MHz : 1390.536
(root@evo:cpufreq)# echo powersave >scaling_governor
(root@evo:cpufreq)# cat /proc/cpuinfo | grep MHz
cpu MHz : 529.728
(root@evo:cpufreq)# echo performance >scaling_governor

Dave

2003-03-12 23:26:49

by Christopher Meredith

[permalink] [raw]
Subject: Re: PowerNow!, cpufreq, and swsusp

Simple question: How do I mount sysfs? Also, any idea on the
swsusp issue? Thanks!

~Christopher

On Wed, 12 Mar 2003 17:40:01 -0100
Dave Jones <[email protected]> wrote:

> On Wed, Mar 12, 2003 at 12:06:33PM -0500, Christopher
Meredith wrote:
>
> > Also, cpufreq doesn't seem to do anything. Should it be
> > working automatically?
>
> no.
>
> > Even when the machine sits unattended
> > for over 8 hours, the fan never turns off and the cpu
> > temperature is consustently 69-70 degrees C.
>
> The kernel doesn't define policy, but exposes the
necessary
> interface to userspace. There are a few folks working on
> tools / scripts to adjust the speed dynamically.
> look through the cpufreq mailing list archives to find
them
> (or google)
>
> > What must I do here?
>
> Read Documentation/cpu-freq/user-guide.txt
>
> short: mount sysfs, and ..
>
> (root@evo:cpufreq)# cd /sys/class/cpu/cpufreq/cpu0/cpufreq
> (root@evo:cpufreq)# cat /proc/cpuinfo | grep MHz
> cpu MHz : 1390.536
> (root@evo:cpufreq)# echo powersave >scaling_governor
> (root@evo:cpufreq)# cat /proc/cpuinfo | grep MHz
> cpu MHz : 529.728
> (root@evo:cpufreq)# echo performance >scaling_governor
>
> Dave
>
> -
> To unsubscribe from this list: send the line "unsubscribe
linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>


---------------------------------------
Use SaintMail! - http://www.saintmail.net

2003-03-12 23:42:08

by Greg KH

[permalink] [raw]
Subject: Re: PowerNow!, cpufreq, and swsusp

On Wed, Mar 12, 2003 at 06:37:32PM -0500, Christopher Meredith wrote:
> Simple question: How do I mount sysfs?

mount -t sysfs none /sys

(make sure you create /sys before you do this...)

greg k-h

2003-03-13 01:31:19

by Nigel Cunningham

[permalink] [raw]
Subject: Re: PowerNow!, cpufreq, and swsusp

On Thu, 2003-03-13 at 06:06, Christopher Meredith wrote:
> # CONFIG_ACPI_SLEEP is not set

Switching this on will give you /proc/acpi/sleep. Then swsusp should be
a step closer.

Regards,

Nigel


2003-03-15 13:45:39

by Christopher Meredith

[permalink] [raw]
Subject: Re: PowerNow!, cpufreq, and swsusp

On Wed, 12 Mar 2003 17:40:01 -0100
Dave Jones <[email protected]> wrote:

> On Wed, Mar 12, 2003 at 12:06:33PM -0500, Christopher Meredith wrote:
>
> > Also, cpufreq doesn't seem to do anything. Should it be
> > working automatically?
>
> no.
>
> > Even when the machine sits unattended
> > for over 8 hours, the fan never turns off and the cpu
> > temperature is consustently 69-70 degrees C.
>
> The kernel doesn't define policy, but exposes the necessary
> interface to userspace. There are a few folks working on
> tools / scripts to adjust the speed dynamically.
> look through the cpufreq mailing list archives to find them
> (or google)
>
> > What must I do here?
>
> Read Documentation/cpu-freq/user-guide.txt
>
> short: mount sysfs, and ..
>
> (root@evo:cpufreq)# cd /sys/class/cpu/cpufreq/cpu0/cpufreq
> (root@evo:cpufreq)# cat /proc/cpuinfo | grep MHz
> cpu MHz : 1390.536
> (root@evo:cpufreq)# echo powersave >scaling_governor
> (root@evo:cpufreq)# cat /proc/cpuinfo | grep MHz
> cpu MHz : 529.728
> (root@evo:cpufreq)# echo performance >scaling_governor
>

All right, it seems that for me, these things reside in /sys/devices/sys/cpu0:
root@Judea:/sys/devices/sys/cpu0# ls
available_scaling_governors name scaling_governor
cpuinfo_max_freq power scaling_max_freq
cpuinfo_min_freq scaling_driver scaling_min_freq

At any rate, 'cat available_scaling_governors' gives this:
performance powersave

If I 'echo powersave > scaling_governor', the fan slows down and the processor registers at about 600+ MHz (down from 1500+). So far so good. But when I 'echo performance > scaling_governor', the entire system locks up and I have to hard reset. Am I still missing something here? Also, I had thought the purpose of this technology was to incrementally scale the clock speed depending upon what the computer was doing, this saving battery power. Is this correct? If so, how do I enable this?

Also, with regard to swsusp, after creating a swap partition and seemingly adding the 'resume' line to lilo.conf, whenever I do 'echo 4 > /proc/acpi/sleep', the computer ditches X and prints ACPI information on all consoles. This seems good at first, but no matter how long I let it sit, it doesn't ever suspend or try to do anything similar (that I can tell). Am I still doing something wrong?

Thanks!

~Christopher