# [SOLVED] Another tedious cpufreq problem

## LittleBug

Yes, I don't know how define it! I simply want my CPUs (AMD PhenomII X4 920) stay in ondemand governor.

I tried http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap3 solution but it hasn't hoped results.

And now some infos

```
# cpufreq-info

cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009

Report errors and bugs to cpufreq@vger.kernel.org, please.

analyzing CPU 0:

  no or unknown cpufreq driver is active on this CPU

  maximum transition latency: 4294.55 ms.

analyzing CPU 1:

  no or unknown cpufreq driver is active on this CPU

  maximum transition latency: 4294.55 ms.

analyzing CPU 2:

  no or unknown cpufreq driver is active on this CPU

  maximum transition latency: 4294.55 ms.

analyzing CPU 3:

  no or unknown cpufreq driver is active on this CPU

  maximum transition latency: 4294.55 ms.

```

```
I_PROCFS=y

CONFIG_ACPI_PROCFS_POWER=y

CONFIG_ACPI_POWER_METER=y

CONFIG_ACPI_SYSFS_POWER=y

CONFIG_ACPI_PROC_EVENT=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_VIDEO=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=y

CONFIG_ACPI_PROCESSOR=m

CONFIG_ACPI_HOTPLUG_CPU=y

# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set

CONFIG_ACPI_THERMAL=m

CONFIG_ACPI_NUMA=y

# CONFIG_ACPI_CUSTOM_DSDT is not set

# CONFIG_ACPI_CUSTOM_DSDT_INITRD is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

# CONFIG_ACPI_PCI_SLOT is not set

CONFIG_ACPI_CONTAINER=y

# CONFIG_ACPI_SBS is not set

CONFIG_X86_ACPI_CPUFREQ=m

# CONFIG_HOTPLUG_PCI_ACPI is not set

CONFIG_PNPACPI=y

CONFIG_ATA_ACPI=y

# CONFIG_PATA_ACPI is not set

# ACPI drivers

# ACPI drivers

```

```
# grep CPUFREQ /usr/src/linux/.config

CONFIG_X86_ACPI_CPUFREQ=m

```

And obviously I can't load acpi-cpufreq module this is what i get when I try:

```
 # modprobe acpi-cpufreq

FATAL: Error inserting acpi_cpufreq (/lib/modules/2.6.32-zen7/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko): No such device

```

same thing for powernow-k8 module

```
# grep CPU_FREQ /usr/src/linux/.config

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

```

Also, when cpufreqd *SHOULD* start at default runlevel says me this 

```
# /etc/init.d/cpufreqd start

 * cpufreqd requires the kernel to be configured with CONFIG_CPU_FREQ

 * Make sure that the appropiate kernel drivers for your CPU are

 * built-in or loaded.

```

Kernel used 2.6.32-zen7 and 2.6.33-zen1 (same errors and stuff)

Googleing I read from somewhere something about ACPI tables on BIOS. After BIOS update (happened with my previous mobo bios doesn't communicate with OS) nothing change. 

With my previous kernel (2.6.28-zen10 no longer in repository neither via third party ebuild T_T) I had no problem ergo it's not a hardware issue.

Any ideas?Last edited by LittleBug on Tue Apr 06, 2010 8:09 pm; edited 1 time in total

----------

## albright

just as a check, what is the output of

locate acpi-cpufreq.ko

----------

## gentoo_ram

My AMD processor uses the "AMD/Opteron PowerNow scaling" driver, not the ACPI one.  Make sure you have that one compiled into the kernel.  My startup scripts do:

echo 'ondemand' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

... for each CPU core.

----------

## LittleBug

Oh, well

```
# locate acpi-cpufreq.ko

/usr/src/linux-2.6.32-zen7/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko

/usr/src/linux-2.6.32-zen7/arch/x86/kernel/cpu/cpufreq/.acpi-cpufreq.ko.cmd

/usr/src/linux-2.6.33-zen1/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko

/usr/src/linux-2.6.33-zen1/arch/x86/kernel/cpu/cpufreq/.acpi-cpufreq.ko.cmd

/lib64/modules/2.6.32-zen7/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko

```

but modprobe acpi-cpufreq still says me

```
FATAL: Error inserting acpi_cpufreq (/lib/modules/2.6.32-zen7/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko): No such device
```

I tried gentoo_ram's solution and errors become more and more... absurd

```
# echo 'ondemand' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

bash: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory

Eddie ame # ls /sys/devices/system/cpu/cpu0

cache  crash_notes  microcode  topology

Eddie ame # mkdir /sys/devices/system/cpu/cpu0/cpufreq

mkdir: cannot create directory `/sys/devices/system/cpu/cpu0/cpufreq': No such file or directory

```

what????   :Shocked:  Of course it does not exist I just tried to create it!  :Confused: 

----------

## albright

your module appears to be in lib64, not lib

are you running x86 or amd64 or what??

----------

## LittleBug

 :Embarassed:  yes I'm running an AMD64 platform but /lib is a link to /lib64 thus, I think, /lib64/modules/2.6.32-zen7/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko and /lib/modules/2.6.32-zen7/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko are the same file (make a link from one point to other say this...). Am I wrong?   :Confused: 

----------

## albright

no - you are quite right - I was just wondering  :Smile: 

have you tried gentoo_ram's idea to compile the powernow module,

in config:

```
< >   AMD Opteron/Athlon64 PowerNow!  
```

instead of the ACPI Processor P-States driver (this was not clear

from your earlier posts)

----------

## LittleBug

modprobinf powernow-k8 module say this

```
modprobe powernow-k8

FATAL: Error inserting powernow_k8 (/lib/modules/2.6.32-zen7/kernel/arch/x86/kernel/cpu/cpufreq/powernow-k8.ko): No such device
```

(I'm sorry for non clearance)

I really don't understand what is happening!

----------

## doctork

 *LittleBug wrote:*   

> modprobinf powernow-k8 module say this
> 
> ```
> modprobe powernow-k8
> 
> ...

 What's happening is you are not configuring your kernel correctly.  On my Phenom (not II, but shouldn't make any difference), I have the following stuff set.

```
 CONFIG_ACPI_PROCFS is not set

# CONFIG_ACPI_PROCFS_POWER is not set <<<<<<<<<<<<<<<<<<<<<<

# CONFIG_ACPI_POWER_METER is not set

CONFIG_ACPI_SYSFS_POWER=y

# CONFIG_ACPI_PROC_EVENT is not set

# CONFIG_ACPI_AC is not set

# CONFIG_ACPI_BATTERY is not set

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=y

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_HOTPLUG_CPU=y

# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set

CONFIG_ACPI_THERMAL=y

CONFIG_ACPI_CUSTOM_DSDT_FILE=""

# CONFIG_ACPI_CUSTOM_DSDT is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

# CONFIG_ACPI_PCI_SLOT is not set

CONFIG_ACPI_CONTAINER=y

# CONFIG_ACPI_SBS is not set

# CONFIG_X86_ACPI_CPUFREQ is not set

--------------------------------------

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

CONFIG_CPU_FREQ_DEBUG=y

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

# CONFIG_X86_ACPI_CPUFREQ is not set

--------------------------------------------

CONFIG_X86_POWERNOW_K8=y  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

```

This works fine on the Phenom system as well as two old Athlon X2 systems.

--

doc

----------

## hielvc

Heres my config liinux-2.6.33 which works with athlon II x4 620, 630 and phenom II x3 440 as well as an old athlon x2 be2300

```
# Power management and ACPI options

#

CONFIG_PM=y

# CONFIG_PM_DEBUG is not set

# CONFIG_SUSPEND is not set

# CONFIG_HIBERNATION is not set

CONFIG_PM_RUNTIME=y

CONFIG_ACPI=y

# CONFIG_ACPI_PROCFS is not set

# CONFIG_ACPI_PROCFS_POWER is not set

CONFIG_ACPI_POWER_METER=y

CONFIG_ACPI_SYSFS_POWER=y

# CONFIG_ACPI_PROC_EVENT is not set

# CONFIG_ACPI_AC is not set

# CONFIG_ACPI_BATTERY is not set

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=y

CONFIG_ACPI_PROCESSOR=y

# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_CUSTOM_DSDT is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_PCI_SLOT=y

CONFIG_X86_PM_TIMER=y

# CONFIG_ACPI_CONTAINER is not set

# CONFIG_ACPI_SBS is not set

# CONFIG_SFI is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=y

# CONFIG_CPU_FREQ_STAT_DETAILS is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=y

CONFIG_X86_POWERNOW_K8=y

# CONFIG_X86_SPEEDSTEP_CENTRINO is not set

# CONFIG_X86_P4_CLOCKMOD is not set

#

# shared options

#

# CONFIG_X86_SPEEDSTEP_LIB is not set

CONFIG_CPU_IDLE=y

CONFIG_CPU_IDLE_GOV_LADDER=y

CONFIG_CPU_IDLE_GOV_MENU=y

```

Its all compiled in, NO modules.

----------

## LittleBug

Sorry guys! I've just tried both configurations but nothing chage   :Crying or Very sad: 

Until now we are focused on kernel configuration and cpufreq, isn't possible that the cause is... I don't know.. anything else?

It's only an idea...

----------

## doctork

 *LittleBug wrote:*   

> Sorry guys! I've just tried both configurations but nothing chage  
> 
> Until now we are focused on kernel configuration and cpufreq, isn't possible that the cause is... I don't know.. anything else?
> 
> It's only an idea...

 Phase of the moon, perhaps?   :Shocked: 

hielvc and I both have things working, so a properly configured kernel apparently works.  You concluded earlier that it couldn't be hardware. I don't understand why you don't have the /sys/devices/system/cpu/cpu?/cpufreq directories.  

Is sysfs mounted on /sys?

If so, how far down the directory structure can you go?  ls -l /sys, ls -l /sys/devices, etc.

Good luck.

--

doc

----------

## hielvc

And or whats the output of 

```
sudo dmesg |grep cpu

cpuidle: using governor ladder

cpuidle: using governor menu

powernow-k8: Found 1 AMD Athlon(tm) II X4 630 Processor processors (4 cpu cores) (version 2.20.00)
```

----------

## LittleBug

I begin to think about moon phase   :Laughing: 

```
 cat /proc/mounts |grep sys

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

```

/sys appare mounted

Path on /sys reach this point

```
ls /sys/devices/system/cpu/cpu0/

cache  crash_notes  microcode  topology

```

no cpufreq directory

I have one on /sys/devices/system/cpu/ but it's empty

```
dmesg |grep cpu

[    0.000000] Initializing cgroup subsys cpuset

[    0.000000] KERNEL supported cpus:

[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106

[    0.000000] NR_CPUS:4 nr_cpumask_bits:4 nr_cpu_ids:4 nr_node_ids:1

[    0.000000] PERCPU: Embedded 27 pages/cpu @ffff880028200000 s81560 r8192 d20840 u524288

[    0.000000] pcpu-alloc: s81560 r8192 d20840 u524288 alloc=1*2097152

[    0.000000] pcpu-alloc: [0] 0 1 2 3 

[    0.000000] HPET: 3 timers in total, 0 timers will be used for per-cpu timer

[    0.748071] work_for_cpu used greatest stack depth: 5272 bytes left

[    0.768044] work_for_cpu used greatest stack depth: 5104 bytes left

[    0.894313] cpuidle: using governor ladder

[    0.901476] cpuidle: using governor menu

[    1.057059] powernow-k8: Found 1 AMD Phenom(tm) II X4 920 Processor processors (4 cpu cores) (version 2.20.00)

```

I don't understand so much in this last output...

----------

## hielvc

The last 3 lines  *Quote:*   

> [    0.894313] cpuidle: using governor ladder
> 
> [    0.901476] cpuidle: using governor menu
> 
> [    1.057059] powernow-k8: Found 1 AMD Phenom(tm) II X4 920 Processor processors (4 cpu cores) (version 2.20.00) 

  shows that your kernel does detect your cpu and that it's setup to use powernow-k8. For some reason its the other sub-systems /proc /sys that are not using it or any cpufreq scaling, as there is nothing in your /sys where mine is

```
ls /sys/devices/system/cpu/cpu0/

cache/  cpufreq/  topology/
```

 Yes moon phases sounds right.

What this means is your kernel is setup right to use cpufreq scaling, but the helper programs aren't seeing/setting up your system to use it. Whats causing that I have no real idea.

----------

## doctork

 *LittleBug wrote:*   

> 
> 
> Path on /sys reach this point
> 
> ```
> ...

 

On my phenom I see:

```
ls /sys/devices/system/cpu/cpu0        

cache  cpufreq  topology
```

I wonder what that "crash_notes" entry might be.  You could try cat'ing it to see if it has any information of value.

--

doc

----------

## LittleBug

```
cat /sys/devices/system/cpu/cpu0/crash_notes 

282193c0

```

Not so helpful actually

----------

## LittleBug

SOLVED! Or at least partially!  :Surprised: 

All this mess was caused by "Cool'n'Quiet" turned off   :Rolling Eyes:  on BIOS settings. Cool'n'Quiet turned on and all CPU@800MHz!

I also set 

```
CONFIG_X86_ACPI_CPUFREQ=m

CONFIG_X86_PHC_K8=m

(before I set CONFIG_X86_POWERNOW_K8=M instead of PHC but I couldn't control frequencies and I tried this one)
```

Now I still can't control frequencies and them are stuck at the lowest frequencies but there's another topic for this (If I remember correctly).

Thank you all!!

----------

