phc-k8_v0.4.0 with kernel 2.6.30

Discuss about PHC here. For problems please use the PHC Help forum
Post Reply
scosu
Posts: 4
Joined: Sun 28. Dec 2008, 13:34

phc-k8_v0.4.0 with kernel 2.6.30

Post by scosu » Sun 14. Jun 2009, 23:09

Just tried to compile the module on kernel 2.6.30 and it failed... also with 2.6.29

so i just searched a little bit the sources of the kernel and tried to fix the problem... i'm really unsure about this stuff because the percpu.h file is very confusing for me...
But it compiles with these changes, didn't test it right now

Code: Select all

diff -Naur phc-k8_v0.4.0/phc-k8.c phc-k8_v0.4.0-perhaps/phc-k8.c
--- phc-k8_v0.4.0/phc-k8.c	2009-03-18 10:20:45.000000000 +0100
+++ phc-k8_v0.4.0-perhaps/phc-k8.c	2009-06-14 23:02:52.310453429 +0200
@@ -653,7 +653,7 @@
 
 	dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
 	data->powernow_table = powernow_table;
-	if (first_cpu(per_cpu(cpu_core_map, data->cpu)) == data->cpu)
+	if (first_cpu(*per_cpu(cpu_core_map, data->cpu)) == data->cpu)
 		print_basics(data);
 
 	for (j = 0; j < data->numps; j++)
@@ -1730,10 +1730,10 @@
 	set_cpus_allowed(current, oldmask);
 
 	if (cpu_family == CPU_HW_PSTATE)
-		pol->cpus = cpumask_of_cpu(pol->cpu);
+		*(pol->cpus) = *get_cpu_mask(pol->cpu);
 	else
-		pol->cpus = per_cpu(cpu_core_map, pol->cpu);
-	data->available_cores = &(pol->cpus);
+		*(pol->cpus) = *per_cpu(cpu_core_map, pol->cpu);
+	data->available_cores = pol->cpus;
 
 	/* Take a crude guess here.
 	 * That guess was in microseconds, so multiply with 1000 */
@@ -1804,7 +1804,7 @@
 	unsigned int khz = 0;
 	unsigned int first;
 
-	first = first_cpu(per_cpu(cpu_core_map, cpu));
+	first = first_cpu(*per_cpu(cpu_core_map, cpu));
 	data = per_cpu(powernow_data, first);
 
 	if (!data)
btw: nice module ;)

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

Re: phc-k8_v0.4.0 with kernel 2.6.30

Post by DavidG » Mon 15. Jun 2009, 10:17

The changes you made could work, I haven't tested it but I think it should work... In the mean time I think this is what people can use for now.

FWIW, I am already in the process of merging all changes on powernow-k8 in 2.6.29 and 2.6.30 into a new 0.4.1 driver. I am adding some conditional blocks, so it still compiles on 2.6.27 (maybe even before that) up to 2.6.30. I just need some time to test it, after that I'll release it... It won't have anything really new, just better kernel versions support...

But I'm glad this popped up, we've been almost screaming for feedback on the driver and now that it doesn't compile on 2.6.29 we finally get it! ;)
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

scosu
Posts: 4
Joined: Sun 28. Dec 2008, 13:34

Re: phc-k8_v0.4.0 with kernel 2.6.30

Post by scosu » Tue 16. Jun 2009, 23:28

the patch doesn't work for me :(...

btw: whats about support for black-edition cpus? i could run with 3ghz but with any powernow it is immediately at 2.6ghz again.

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

Re: phc-k8_v0.4.0 with kernel 2.6.30

Post by DavidG » Wed 17. Jun 2009, 09:49

scosu wrote:the patch doesn't work for me :(...

btw: whats about support for black-edition cpus? i could run with 3ghz but with any powernow it is immediately at 2.6ghz again.
Great, I finally found someone with a black-edition! Until now I did not know anyone with a Black-Edition and whether it would even work on the vanilla powernow-k8 driver. If I'd had the money I'd buy one myself for testing, but that's not the case...

Apparently the multiplier-setting you run the processor on is not propagated through the ACPI BIOS to the kernel... I think I can find a way around. I will (need to) contact you when I start working on a solution... I'll let you know!
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

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

Re: phc-k8_v0.4.0 with kernel 2.6.30

Post by DavidG » Tue 23. Jun 2009, 10:52

There's a new 0.4.1 driver that solves the issue. Thanks for your input, especially on the 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

v0lle85
Posts: 9
Joined: Fri 12. Jun 2009, 23:51

Re: phc-k8_v0.4.0 with kernel 2.6.30

Post by v0lle85 » Thu 25. Jun 2009, 13:07

Hi!

Just wanted to mention, that my Phenom II X2 550 is Black Edition also.. but you need k8, not k10, right?

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

Re: phc-k8_v0.4.0 with kernel 2.6.30

Post by DavidG » Thu 25. Jun 2009, 13:21

v0lle85 wrote:Hi!

Just wanted to mention, that my Phenom II X2 550 is Black Edition also.. but you need k8, not k10, right?
Right ;) And the linux kernel cpufreq subsystem doesn't even support runtime changes to frequency-tables, so it may take a while before you can actually choose frequencies that are not advertised by your ACPI data...

But it's very useful to already know someone that has a BE Phenom...
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