Kernel oops with Athlon 64 X2 Black Edition

If you have trouble with PHC you can ask and hope for help here.
fusterjj
Posts: 10
Joined: Sat 18. Jul 2009, 07:18
[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

Kernel oops with Athlon 64 X2 Black Edition

Post by fusterjj » Sat 18. Jul 2009, 18:42

Hello,

I installed the K8 v0.4.1 PHC module by following the instructions for rebuilding the Ubuntu 9.04 kernel and then installation via DKMS. My processor's normal top speed is 2600, but I have it overclocked to 3000.

When I modprobe the PHC module in, I get an oops (see below). I should note that I got a similar oops using the default Ubuntu 9.04 kernel when powernow initializes. The only way to avoid this while keeping the processor at 3000 was to disable Cool'n'Quiet in the BIOS.

Let me know if this is impossible, but what I'm hoping I can do is enable cpu frequency scaling and still have the CPU's top freq be the overclocked speed.

I did try using "be_maxfid=0x16", but that didn't seem to have any effect.

If you need me to repeat this without the nvidia kernel module loaded, I can, but it definitely happened with powernow in the default Ubuntu kernel, which was naturally before nvidia.ko since it is built-in.

Thanks!

Code: Select all

[  147.994383] phc-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ processors (2 cpu cores) (version 2.20.00)
[  147.994581] phc-k8:    0 : fid 0x12 (2600 MHz), vid 0x9
[  147.994584] phc-k8:    1 : fid 0x10 (2400 MHz), vid 0xb
[  147.994585] phc-k8:    2 : fid 0xe (2200 MHz), vid 0xd
[  147.994587] phc-k8:    3 : fid 0xc (2000 MHz), vid 0xf
[  147.994588] phc-k8:    4 : fid 0xa (1800 MHz), vid 0x11
[  147.994589] phc-k8:    5 : fid 0x2 (1000 MHz), vid 0x12
[  147.995080] BUG: unable to handle kernel paging request at ffff8808b89de1f8
[  147.995084] IP: [<ffffffff8057a2cb>] cpufreq_stats_update+0x4b/0x70
[  147.995091] PGD 202063 PUD 0
[  147.995093] Oops: 0002 [#1] SMP
[  147.995096] last sysfs file: /sys/devices/pci0000:00/0000:00:05.2/host4/target4:0:0/4:0:0:0/block/sdc/sdc1/stat
[  147.995099] Dumping ftrace buffer:
[  147.995102]    (ftrace buffer empty)
[  147.995103] CPU 0
[  147.995105] Modules linked in: phc_k8(+) xt_multiport binfmt_misc ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp video output input_polldev kvm_amd kvm lp snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_midi_emul snd_emu10k1 snd_ac97_codec ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm snd_page_alloc snd_util_mem snd_hwdep snd_seq_dummy cfi_cmdset_0002 snd_seq_oss snd_seq_midi jedec_probe snd_rawmidi cfi_probe snd_seq_midi_event gen_probe snd_seq cfi_util psmouse snd_timer snd_seq_device ppdev emu10k1_gp ck804xrom mtd chipreg k8temp serio_raw snd pcspkr soundcore nvidia(P) gameport map_funcs parport_pc parport i2c_nforce2 joydev xfs usbhid usb_storage forcedeth floppy raid10 raid456 async_xor async_memcpy async_tx xor raid1 raid0 multipath linear
[  147.995149] Pid: 5511, comm: modprobe Tainted: P        W  2.6.28.9-phc001 #1
[  147.995151] RIP: 0010:[<ffffffff8057a2cb>]  [<ffffffff8057a2cb>] cpufreq_stats_update+0x4b/0x70
[  147.995154] RSP: 0018:ffff8800b444d9e8  EFLAGS: 00010246
[  147.995156] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8800b89de200
[  147.995157] RDX: 00000000ffffffff RSI: ffff8800b7d5dc80 RDI: ffffffff80b5a5cc
[  147.995159] RBP: ffff8800b444d9f8 R08: ffff8800b444db28 R09: ffff8800031d3400
[  147.995161] R10: 0000000000000006 R11: 00000000ffffffff R12: 00000000ffff6b8e
[  147.995162] R13: 00000000ffffffff R14: ffff8800b444db28 R15: 0000000000000001
[  147.995164] FS:  00007f4eb8ad36f0(0000) GS:ffffffff80a80000(0000) knlGS:0000000000000000
[  147.995166] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  147.995168] CR2: ffff8808b89de1f8 CR3: 0000000094d7c000 CR4: 00000000000006a0
[  147.995170] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  147.995171] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  147.995173] Process modprobe (pid: 5511, threadinfo ffff8800b444c000, task ffff8800bb598000)
[  147.995175] Stack:
[  147.995176]  0000000000000000 ffff8800b7d5dc80 ffff8800b444da28 ffffffff8057a5b4
[  147.995179]  ffff8800b444da58 0000000000000000 00000000fffffffe 0000000000000000
[  147.995182]  ffff8800b444da68 ffffffff806904ff ffff8800b444da48 ffffffff80b5a5c0
[  147.995185] Call Trace:
[  147.995187]  [<ffffffff8057a5b4>] cpufreq_stat_notifier_trans+0x94/0x100
[  147.995190]  [<ffffffff806904ff>] notifier_call_chain+0x3f/0x80
[  147.995194]  [<ffffffff802693a6>] __srcu_notifier_call_chain+0x56/0x80
[  147.995198]  [<ffffffffa0c0c07c>] ? query_current_values_with_pending_wait+0x5c/0xe0 [phc_k8]
[  147.995204]  [<ffffffff802693e1>] srcu_notifier_call_chain+0x11/0x20
[  147.995206]  [<ffffffff805782a2>] cpufreq_notify_transition+0xc2/0xf0
[  147.995209]  [<ffffffffa0c0cea0>] powernowk8_target+0x340/0x820 [phc_k8]
[  147.995213]  [<ffffffff805794c2>] __cpufreq_driver_target+0x32/0x40
[  147.995215]  [<ffffffff8057aa75>] cpufreq_governor_performance+0x25/0x30
[  147.995218]  [<ffffffff80578125>] __cpufreq_governor+0x65/0x100
[  147.995220]  [<ffffffff805784db>] __cpufreq_set_policy+0x12b/0x170
[  147.995223]  [<ffffffff80579eab>] cpufreq_add_dev+0x54b/0x5a0
[  147.995225]  [<ffffffff8057a0a0>] ? handle_update+0x0/0x10
[  147.995228]  [<ffffffff804ad9d8>] sysdev_driver_register+0xa8/0x130
[  147.995233]  [<ffffffff80578b25>] cpufreq_register_driver+0x85/0x170
[  147.995235]  [<ffffffffa0c0ec06>] powernowk8_init+0x7f/0x83 [phc_k8]
[  147.995239]  [<ffffffffa0c0eb87>] ? powernowk8_init+0x0/0x83 [phc_k8]
[  147.995242]  [<ffffffff8020a03b>] do_one_initcall+0x3b/0x170
[  147.995245]  [<ffffffff80279e01>] ? load_module+0x19e1/0x1d00
[  147.995251]  [<ffffffff8027a1cd>] sys_init_module+0xad/0x1e0
[  147.995254]  [<ffffffff8021245a>] system_call_fastpath+0x16/0x1b
[  147.995256] Code: 05 1b 90 41 00 48 c7 c2 98 7b a4 80 48 8b 04 d8 48 8b 40 08 48 8b 34 02 48 8b 4e 20 48 85 c9 74 0e 8b 56 18 4c 89 e0 48 2b 46 08 <48> 01 04 d1 4c 89 66 08 48 c7 c7 cc a5 b5 80 e8 21 22 cb ff 90
[  147.995277] RIP  [<ffffffff8057a2cb>] cpufreq_stats_update+0x4b/0x70
[  147.995280]  RSP <ffff8800b444d9e8>
[  147.995281] CR2: ffff8808b89de1f8
[  147.995283] ---[ end trace 5d90e134ae786da5 ]---

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

Re: Kernel oops with Athlon 64 X2 Black Edition

Post by DavidG » Sat 18. Jul 2009, 22:55

If you modprobe the driver after you have removed it or the powernow-k8 default, the cpufreq_stats module has to be unloaded first. But AFAIK, /etc/modprobe.d/dkms.conf should contain the code to do this.

Can you verify this by posting the output of:

Code: Select all

modprobe -r -v -n powernow-k8
modprobe -r -v -n phc-k8
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

fusterjj
Posts: 10
Joined: Sat 18. Jul 2009, 07:18
[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: Kernel oops with Athlon 64 X2 Black Edition

Post by fusterjj » Sat 25. Jul 2009, 01:08

Code: Select all

joel@periphas:~$ modprobe -rvn powernow-k8
WARNING: All config files need .conf: /etc/modprobe.d/oss-compat, it will be ignored in a future release.
remove /sbin/modprobe -r cpufreq_stats && { /sbin/modprobe --ignore-remove -r powernow-k8 ; }
joel@periphas:~$ modprobe -rvn phc-k8
WARNING: All config files need .conf: /etc/modprobe.d/oss-compat, it will be ignored in a future release.
remove /sbin/modprobe -r cpufreq_stats && { /sbin/modprobe --ignore-remove -r phc-k8 ; }
It seems that cpufreq_stats is built-in in this kernel, however:

Code: Select all

joel@periphas:~$ cat /boot/config-2.6.28.9-phc001 |grep CPU_FREQ_STAT
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
But I can say that I did not remove any other module before loading phc-k8. When I boot the system, there is no cpu frequency module running as far as I know. The first such module that loads is phc-k8.

Should I rebuild the kernel with CONFIG_CPU_FREQ_STAT=m?

Thanks for the help!

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

Re: Kernel oops with Athlon 64 X2 Black Edition

Post by DavidG » Sat 25. Jul 2009, 16:23

fusterjj wrote:Should I rebuild the kernel with CONFIG_CPU_FREQ_STAT=m?

Thanks for the help!
Yes you should, but I noticed our PPA kernel doesn't do that either... So we'll have to rebuild that too.
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

fusterjj
Posts: 10
Joined: Sat 18. Jul 2009, 07:18
[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: Kernel oops with Athlon 64 X2 Black Edition

Post by fusterjj » Sat 25. Jul 2009, 19:44

Well, rebuilding with cpufreq_stats as a module fixed the oops. I can't seem to get my proc to run at 3GHz after loading the phc-k8 module though. As soon as I load it /proc/cpuinfo shows 2600MHz instead of the 3000 it shows after boot. Here is how I'm loading the module:

Code: Select all

modprobe phc-k8 be_maxfid=22 direct_transitions=1
Here is the dmesg output:

Code: Select all

[  189.698564] phc-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ processors (2 cpu cores) (version 2.20.00)
[  189.698631] phc-k8:    4 : fid 0x12 (2600 MHz), vid 0x9
[  189.698634] phc-k8:    6 : fid 0x10 (2400 MHz), vid 0xb
[  189.698636] phc-k8:    8 : fid 0xe (2200 MHz), vid 0xd
[  189.698637] phc-k8:    10 : fid 0xc (2000 MHz), vid 0xf
[  189.698639] phc-k8:    12 : fid 0xa (1800 MHz), vid 0x11
[  189.698640] phc-k8:    20 : fid 0x2 (1000 MHz), vid 0x12
Thanks.

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

Re: Kernel oops with Athlon 64 X2 Black Edition

Post by DavidG » Sat 25. Jul 2009, 22:41

fusterjj wrote:Well, rebuilding with cpufreq_stats as a module fixed the oops. I can't seem to get my proc to run at 3GHz after loading the phc-k8 module though. As soon as I load it /proc/cpuinfo shows 2600MHz instead of the 3000 it shows after boot. Here is how I'm loading the module:

Code: Select all

modprobe phc-k8 be_maxfid=22 direct_transitions=1
Here is the dmesg output:

Code: Select all

[  189.698564] phc-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ processors (2 cpu cores) (version 2.20.00)
[  189.698631] phc-k8:    4 : fid 0x12 (2600 MHz), vid 0x9
[  189.698634] phc-k8:    6 : fid 0x10 (2400 MHz), vid 0xb
[  189.698636] phc-k8:    8 : fid 0xe (2200 MHz), vid 0xd
[  189.698637] phc-k8:    10 : fid 0xc (2000 MHz), vid 0xf
[  189.698639] phc-k8:    12 : fid 0xa (1800 MHz), vid 0x11
[  189.698640] phc-k8:    20 : fid 0x2 (1000 MHz), vid 0x12
Thanks.
You will have to add an fid:vid pair for that entry, because the driver cannot guess a save value, so for example:

Code: Select all

echo "22:6 18:9 16:11 14:13 12:15 10:17 2:18" |sudo tee /sys/device/system/cpu/cpu0/cpufreq/phc_controls
echo "22:6 18:9 16:11 14:13 12:15 10:17 2:18" |sudo tee /sys/device/system/cpu/cpu1/cpufreq/phc_controls
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

fusterjj
Posts: 10
Joined: Sat 18. Jul 2009, 07:18
[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: Kernel oops with Athlon 64 X2 Black Edition

Post by fusterjj » Sun 26. Jul 2009, 05:58

Ahh...makes sense. OK so now I have this output:

Code: Select all

[25757.121716] phc-k8:    0 : fid 0x16 (3000 MHz), vid 0x9
[25757.121720] phc-k8:    2 : fid 0x14 (2800 MHz), vid 0x9
[25757.121721] phc-k8:    4 : fid 0x12 (2600 MHz), vid 0x9
[25757.121723] phc-k8:    6 : fid 0x10 (2400 MHz), vid 0xb
[25757.121724] phc-k8:    8 : fid 0xe (2200 MHz), vid 0xd
[25757.121725] phc-k8:    10 : fid 0xc (2000 MHz), vid 0xf
[25757.121726] phc-k8:    12 : fid 0xa (1800 MHz), vid 0x11
[25757.121728] phc-k8:    20 : fid 0x2 (1000 MHz), vid 0x12
But if I check some of the sysfs entries:

Code: Select all

root@periphas:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_available_frequencies 
3000000 2800000 2600000 2400000 2200000 2000000 1800000 1000000 
root@periphas:/sys/devices/system/cpu/cpu0/cpufreq# cat cpuinfo_max_freq 
3000000
root@periphas:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_max_freq
2600000
root@periphas:/sys/devices/system/cpu/cpu0/cpufreq# echo 3000000 > scaling_max_freq 
root@periphas:/sys/devices/system/cpu/cpu0/cpufreq# cat scaling_max_freq 
2600000
As you see I'm unable to set the maximum scaling frequency to 3GHz, even though it's listed in "scaling_available_frequencies". I've tried the userspace governor and using scaling_setspeed as well. What could make that happen? I've done some searches and it seems like some people have had this issue when their laptop batteries are missing or their AC adapter is malfunctioning, but obviously this is a desktop machine...

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

Re: Kernel oops with Athlon 64 X2 Black Edition

Post by DavidG » Sun 26. Jul 2009, 22:57

A long shot... Does it help if you change the scaling governor? E.g.:

Code: Select all

echo performance|sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance|sudo tee /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo ondemand|sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand|sudo tee /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

fusterjj
Posts: 10
Joined: Sat 18. Jul 2009, 07:18
[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: Kernel oops with Athlon 64 X2 Black Edition

Post by fusterjj » Mon 27. Jul 2009, 02:06

Sadly that did not help. I tried userspace, performance, and ondemand, and they all max out at 2.6GHz.

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

Re: Kernel oops with Athlon 64 X2 Black Edition

Post by DavidG » Tue 28. Jul 2009, 11:55

I'll dig further into the kernel code, but AFAIK I'm already doing everything that should be necessary for the cpufreq subsystem to work... :(

Code: Select all

	/* Recalculate the min/max frequencies */
	cpufreq_frequency_table_cpuinfo(pol, data->powernow_table);
	/* Publish our new cpufreq frequency table to the cpufreq subsystem */
	cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu);
	/* Print basic info on our fresh settings */
	print_basics(data);
	/* Start using new fid/vid table */
	powernowk8_target(pol, pol->cur, CPUFREQ_RELATION_L);
That's all to it... But somehow it is not working. I'll have to ask the cpufreq developers what happens here, but it will be hard since I am do not own a Black Edition processor...
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

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