Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

If you have trouble with PHC you can ask and hope for help here.
Smok Wawelski
Posts: 8
Joined: Sat 5. Sep 2009, 10:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by Smok Wawelski » Sat 5. Sep 2009, 22:10

Hi,

I believe the issue I observe is related to the one discussed here, nonetheless I've decided to open a separate thread.

My CPU is Athlon 64 X2 5000+ Black Edition. I overclocked it to 3 GHz (15 x 200 MHz) and enabled Cool'n'Quiet in the BIOS (i.e. enabled passing _PSS ACPI structures).

I run Ubuntu 9.04 in 32-bit mode using the PPA kernel.

Code: Select all

# uname -a
Linux localhost 2.6.28-15-server #50~undervolt2-Ubuntu SMP Fri Aug 21 11:19:47 UTC 2009 i686 GNU/Linux
The problem is I can't push the processor past its nominal frequency (i.e. 2,6 GHz) when Cool'n'Quiet is enabled, no matter what governor is chosen.

The BIOS sets the following fid:vid table by default:

Code: Select all

powernow-k8:    4 : fid 0x12 (2600 MHz), vid 0xa
powernow-k8:    6 : fid 0x10 (2400 MHz), vid 0xc
powernow-k8:    8 : fid 0xe (2200 MHz), vid 0xe
powernow-k8:    10 : fid 0xc (2000 MHz), vid 0x10
powernow-k8:    12 : fid 0xa (1800 MHz), vid 0x10
powernow-k8:    20 : fid 0x2 (1000 MHz), vid 0x12
I have modified /etc/modprobe.d/local.conf to include:

Code: Select all

options powernow-k8 direct_transitions=1 be_maxfid=22
and put the following into /etc/rc.local:

Code: Select all

echo "22:8 20:8 18:10 16:12 14:14 12:16 10:16 2:18" > /sys/devices/system/cpu/cpu1/cpufreq/phc_controls
which results in the following fid:vid pairs:

Code: Select all

powernow-k8:    0 : fid 0x16 (3000 MHz), vid 0x8
powernow-k8:    2 : fid 0x14 (2800 MHz), vid 0x8
powernow-k8:    4 : fid 0x12 (2600 MHz), vid 0xa
powernow-k8:    6 : fid 0x10 (2400 MHz), vid 0xc
powernow-k8:    8 : fid 0xe (2200 MHz), vid 0xe
powernow-k8:    10 : fid 0xc (2000 MHz), vid 0x10
powernow-k8:    12 : fid 0xa (1800 MHz), vid 0x10
powernow-k8:    20 : fid 0x2 (1000 MHz), vid 0x12
Furthermore, /etc/default/cpufrequtils contains the following:

Code: Select all

ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED=3000000
MIN_SPEED=1000000
The result is pretty much the same as in the post I'm referring to:

Code: Select all

# cpufreq-info
cpufrequtils 004: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to cpufreq@lists.linux.org.uk, please.
analyzing CPU 0:
  driver: powernow-k8
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 1000 MHz - 3.00 GHz
  available frequency steps: 3.00 GHz, 2.80 GHz, 2.60 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1000 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 1000 MHz and 2.60 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1000 MHz (asserted by call to hardware).
  cpufreq stats: 2.60 GHz:0,00%, 2.40 GHz:0,00%, 2.20 GHz:0,00%, 2.00 GHz:0,00%, 1.80 GHz:0,00%, 1000 MHz:0,00%
analyzing CPU 1:
  driver: powernow-k8
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 1000 MHz - 3.00 GHz
  available frequency steps: 3.00 GHz, 2.80 GHz, 2.60 GHz, 2.40 GHz, 2.20 GHz, 2.00 GHz, 1.80 GHz, 1000 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 1000 MHz and 2.60 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1000 MHz (asserted by call to hardware).
  cpufreq stats: 2.60 GHz:0,00%, 2.40 GHz:0,00%, 2.20 GHz:0,00%, 2.00 GHz:0,00%, 1.80 GHz:0,00%, 1000 MHz:0,00%

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by DavidG » Mon 7. Sep 2009, 09:28

You could try to use be_maxfid=23, for some reason it seems to work. However, obviously there's a bug somewhere, but I rely on BE owners to help me solve that problem so I can only give you the workaround... Since I don't have a Black Edition processor, I am unable to find or solve this bug or even maintain Black Edition support...
A bank is a place where they lend you an umbrella in fair weather and ask for it back when it begins to rain -- R. Frost

Smok Wawelski
Posts: 8
Joined: Sat 5. Sep 2009, 10:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by Smok Wawelski » Mon 7. Sep 2009, 11:40

Unfortunately passing the option be_maxfid=23 to the module doesn't help. Do I need to perform other configuration changes?

I'm happy to test patches and provide debugging output.

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by DavidG » Mon 14. Sep 2009, 14:28

I'm sorry I haven't had time to answer your questions until now, but I'm rather busy at the moment.
  • If you use be_maxfid=23, is the cpufreq-info still the same?
  • Does it help at all to unload cpufreq_stats first and do

    Code: Select all

    modprobe -r powernow-k8
    modprobe -r cpufreq_stats
    modprobe powernow-k8 be_maxfid=23 direct_transitions=1

    And then echoing the new settings into phc_controls? Writing this post, it suddenly became clear to me that it (the Linux-PHC PPA kernel) may not do that by default, so I really would like to know this... (If this does work: please try with be_maxfid=22 as well)
  • Does it help if you install the phc-k8 module instead? This should yield the same result as the previous exercise.
If I would need you to rebuild the kernel, would that be OK? Because I would like to do more experiments, regardless of the outcome of those three exercises...
A bank is a place where they lend you an umbrella in fair weather and ask for it back when it begins to rain -- R. Frost

Smok Wawelski
Posts: 8
Joined: Sat 5. Sep 2009, 10:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by Smok Wawelski » Mon 14. Sep 2009, 23:58

DavidG wrote:If you use be_maxfid=23, is the cpufreq-info still the same?
Yup, it's the same.
DavidG wrote:Does it help at all to unload cpufreq_stats first and do

Code: Select all

modprobe -r powernow-k8
modprobe -r cpufreq_stats
modprobe powernow-k8 be_maxfid=23 direct_transitions=1

And then echoing the new settings into phc_controls? Writing this post, it suddenly became clear to me that it (the Linux-PHC PPA kernel) may not do that by default, so I really would like to know this... (If this does work: please try with be_maxfid=22 as well)
It's impossible to remove powernow-k8. Strange, as there's no module loaded that depends on it; also no process is accessing respective /sys subtree. I stopped almost anything (including cpufrequtils, hal, dbus etc.), removed modules k8temp, nvidia, kvm, vboxdrv et al. and it still doesn't work.
DavidG wrote:Does it help if you install the phc-k8 module instead? This should yield the same result as the previous exercise.
Ditto.
DavidG wrote:If I would need you to rebuild the kernel, would that be OK? Because I would like to do more experiments, regardless of the outcome of those three exercises...
No problem at all. However, I'd prefer them to be compiled/packaged/installed "Debian way".

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by DavidG » Tue 15. Sep 2009, 09:07

Smok Wawelski wrote:It's impossible to remove powernow-k8. Strange, as there's no module loaded that depends on it; also no process is accessing respective /sys subtree. I stopped almost anything (including cpufrequtils, hal, dbus etc.), removed modules k8temp, nvidia, kvm, vboxdrv et al. and it still doesn't work.
I made a mistake in my previous post, you first have to remove the cpufreq_stats module and then powernow-k8, it's best to create a file /etc/modprobe.d/powenow-k8.conf as root, containing:

Code: Select all

remove powernow-k8 /sbin/modprobe -r cpufreq_stats && { /sbin/modprobe --ignore-remove -r powernow-k8 ; }
The cpufreq-stats driver is not explicitly depending on powernow-k8 but it is implicitly. Since the module is hanging you cannot remove/replace it anymore until you reboot Linux.
DavidG wrote:Does it help if you install the phc-k8 module instead? This should yield the same result as the previous exercise.
Ditto.
Did you reboot in the mean time? If not, the powernow-k8 was still hanging... Could you try again after rebooting and this time add the '-v' option when you execute modprobe and post the output. And could you also post the output of: dmesg|grep k8

Thanks in advance...

Smok Wawelski
Posts: 8
Joined: Sat 5. Sep 2009, 10:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by Smok Wawelski » Tue 15. Sep 2009, 23:24

DavidG wrote:I made a mistake in my previous post, you first have to remove the cpufreq_stats module and then powernow-k8, it's best to create a file /etc/modprobe.d/powenow-k8.conf as root, containing:

Code: Select all

remove powernow-k8 /sbin/modprobe -r cpufreq_stats && { /sbin/modprobe --ignore-remove -r powernow-k8 ; }
The cpufreq-stats driver is not explicitly depending on powernow-k8 but it is implicitly. Since the module is hanging you cannot remove/replace it anymore until you reboot Linux.
That doesn't help - the powernow-k8 module sits tight. I even tried to boot into the recovery mode, without any success - once you modprobe powernow-k8 it's impossible to remove it, even with rmmod -f.
DavidG wrote:
DavidG wrote:Does it help if you install the phc-k8 module instead? This should yield the same result as the previous exercise.
Ditto.
Did you reboot in the mean time? If not, the powernow-k8 was still hanging... Could you try again after rebooting and this time add the '-v' option when you execute modprobe and post the output. And could you also post the output of: dmesg|grep k8
I understand that powernow-k8 in the PPA kernel is in fact the phc-k8 module. After a reboot, I still can't remove phc-k8 ("module is in use").
I did modprobe -v in recovery mode (as powernow-k8/phc-k8 seems to be automatically loaded) and here's the output:

Code: Select all

insmod /lib/modules/2.6.28-15-generic/kernel/arch/x86/kernel/cpu/cpufreq/powernow-k8.ko be_maxfid=22 direct_transitions=1
Withe be_maxfid=22, the dmesg | grep k8 output contains the following:

Code: Select all

[   20.752997] powernow-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ processors (2 cpu cores) (version 2.20.00)
[   20.753063] powernow-k8:    4 : fid 0x12 (2600 MHz), vid 0xa
[   20.753066] powernow-k8:    6 : fid 0x10 (2400 MHz), vid 0xc
[   20.753068] powernow-k8:    8 : fid 0xe (2200 MHz), vid 0xe
[   20.753069] powernow-k8:    10 : fid 0xc (2000 MHz), vid 0x10
[   20.753071] powernow-k8:    12 : fid 0xa (1800 MHz), vid 0x10
[   20.753072] powernow-k8:    20 : fid 0x2 (1000 MHz), vid 0x12
[   37.754229] powernow-k8:    0 : fid 0x16 (3000 MHz), vid 0x8
[   37.754232] powernow-k8:    2 : fid 0x14 (2800 MHz), vid 0x8
[   37.754233] powernow-k8:    4 : fid 0x12 (2600 MHz), vid 0xa
[   37.754235] powernow-k8:    6 : fid 0x10 (2400 MHz), vid 0xc
[   37.754236] powernow-k8:    8 : fid 0xe (2200 MHz), vid 0xe
[   37.754238] powernow-k8:    10 : fid 0xc (2000 MHz), vid 0x10
[   37.754239] powernow-k8:    12 : fid 0xa (1800 MHz), vid 0x10
[   37.754240] powernow-k8:    20 : fid 0x2 (1000 MHz), vid 0x12
With be_maxfid=23, the "index" (0..20) is increased by 1, so it becomes (1..21). The second set of fid:vid pairs is a result of fiddling with /sys/devices/system/cpu/cpu0/cpufreq/phc_controls (please refer to the initial post).

User avatar
DavidG
Posts: 180
Joined: Fri 18. Jul 2008, 11:25
Contact:

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by DavidG » Wed 16. Sep 2009, 11:25

Your dmesg output should contain some error about unloading powernow-k8 or phc-k8, but I don't see any, which is odd... At the moment I have no idea why it doesn't unload. If it does unload cpufreq_stats first, it should work. Maybe I can see what is happening if you could also post the output of:

Code: Select all

modprobe -r -v powernow-k8; sleep 1s; dmesg|tail -20
For the two other Black Edition users I know, using be_maxfid=23 helped to get 22 working, but I have no clue why that is working and not 22 as maxfid and I have no clue why it is not working at all for you...

Could you install msr-tools (sudo apt-get install msr-tools) and post the output of:

Code: Select all

sudo modprobe msr; sleep 1s; sudo rdmsr 0xc0010042
A bank is a place where they lend you an umbrella in fair weather and ask for it back when it begins to rain -- R. Frost

Smok Wawelski
Posts: 8
Joined: Sat 5. Sep 2009, 10:21
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by Smok Wawelski » Wed 16. Sep 2009, 22:56

DavidG wrote:Your dmesg output should contain some error about unloading powernow-k8 or phc-k8, but I don't see any, which is odd... At the moment I have no idea why it doesn't unload. If it does unload cpufreq_stats first, it should work. Maybe I can see what is happening if you could also post the output of:

Code: Select all

modprobe -r -v powernow-k8; sleep 1s; dmesg|tail -20
Nope, it's not related to it, nothing other than the lines I posted before shows in the kernel log (I ignored the output from other modules, which I compared to the ones from other bootups - no strange errors, warnings etc.). I had already tried to unload cpufreq_stats by hand before trying to remove powernow-k8.
DavidG wrote:For the two other Black Edition users I know, using be_maxfid=23 helped to get 22 working, but I have no clue why that is working and not 22 as maxfid and I have no clue why it is not working at all for you...
Believe me, ASUS is evil. If Linux-PHC fails at recognizing my Athlon Black Edition, I will try to embed fake _PSS table into DSDT and make it visible to the driver. I wasn't the first one to think about it...
DavidG wrote:Could you install msr-tools (sudo apt-get install msr-tools) and post the output of:

Code: Select all

sudo modprobe msr; sleep 1s; sudo rdmsr 0xc0010042
Ubuntu 9.04 has an ancient version of msr-utils, so:

Code: Select all

# rdmsr 0xc0010042
rdmsr:pread: Invalid argument
I've compiled the most recent version of msr-utils and here are the results:
  • @1000 MHz:

    Code: Select all

    # msr-tools-1.2/rdmsr 0xc0010042
    31081212082a0802
  • @2600 MHz:

    Code: Select all

    # msr-tools-1.2/rdmsr 0xc0010042
    3108120a082a0812

lxp
Posts: 42
Joined: Sat 26. Sep 2009, 22:27
Contact:

Re: Can't push an oc'ed Athlon Bl. Ed. past its nominal freq

Post by lxp » Wed 30. Sep 2009, 20:01

I own a Phenom II 955 BE and run in somewhat the same problem while experimenting with k10ctl and powernow_k8.
I tried to overclock and powernow_k8 recognized the higher frequencies but it didn't use them.
This is very similar to your problem, so I hope it will help you too.

After 2 days of digging in the kernel code I found out that cpufreq has a notifier "feature", which allows other kernel modules to verify the frequency range and also allows them to apply limits.
Fortunately only a very low amount of modules use this feature and the acpi processor module is one of them. It's thermal part verifies the frequencies against some BIOS values to prevent CPU overheating. This results for me in a limit to the maximum standard frequency of 3200MHz. :(

Now the solution:
Fortunately the kernel 2.6.25 introduces some parameters to disable this frequency verification in the processor module, because there were some problems with broken BIOSes.
Try to append the kernel option

Code: Select all

processor.ignore_ppc=1
on boot and try again loading powernow-k8/phc-k8 with

Code: Select all

direct_transitions=1 be_maxfid=22
and maybe

Code: Select all

direct_transitions=1 be_maxfid=23
if you like. ;)

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable