phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 5.1

Discuss about PHC here. For problems please use the PHC Help forum
lio
Posts: 90
Joined: Wed 2. Mar 2011, 18:37

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by lio » Thu 5. Jan 2012, 12:27

maui_muc wrote:Blacklisting both modules acpi_cpufreq and cpufreq_stats and additionally putting phc-intel to /etc/modules solves the problem.
This workaround should not be needed. For non dkms installations the phc-intel.modprobe file in the package is installed, which does take care of this. And for dkms installations the same stuff is added through a directive in dkms.conf.

But there is a subtle bug in newer dkms itself. If you don't have a dkms or dkms.conf or phc-intel.conf file in /etc/modprobe.d/ or a /etc/modules.conf or /etc/modprobe.conf file, dkms does not create one of those files and so it doesn't add the required directives.

My recommended workaround would be: create a empty file /etc/modprobe.d/phc-intel.conf and reinstall the whole package. Benefit: On phc-intel removal, you don't need to remember your hand made changes and revert it to load the original acpi_cpufreq module. If this doesn't work for you, please drop a message.

Dirk

cucio
Posts: 6
Joined: Mon 4. Jan 2010, 19:42

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by cucio » Tue 31. Jan 2012, 00:15

I am using this patch in Fedora 15 (kernel 2.6.41).

After some trial and error I ended up creating a symlink in inc/ pointing 2.6.41 to 3.0 and then built the dkms RPM and installed it.

All went well, but I also needed to manually copy phc-intel.modprobe as /etc/modprobe.d/phc-intel.conf

Thanks for your efforts!

lio
Posts: 90
Joined: Wed 2. Mar 2011, 18:37

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by lio » Wed 1. Feb 2012, 17:07

cucio wrote:I ended up creating a symlink in inc/ pointing 2.6.41 to 3.0
You should symlink or rename 3.1 as this is the version Fedora names 2.6.41. (2.6.40 is really 3.0) But good to see it's working :)

Dirk

lio
Posts: 90
Joined: Wed 2. Mar 2011, 18:37

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by lio » Sun 14. Jul 2013, 14:43

Just updated phc-intel-pack for changes in kernel 3.9.6 and 3.10

stg20
Posts: 3
Joined: Tue 23. Jul 2013, 14:20

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by stg20 » Tue 23. Jul 2013, 14:45

I'd like to share my experience with using PHC on Debian 7.0 (Wheezy).

First I tried it on my notebook with AMD Sempron and phc-k8 was working perfectly. Using wattmeter I was able to confirm that with lowering CPU voltage, power consumption is going down. Everything perfect.

Being so happy, I thought to do the same on my PC with Intel Core 2 Duo, running the very same Debian Wheezy with the very same original kernel (3.2.0). So I downloaded phc-intel package from this topic and executed make:

Code: Select all

root@MIKA:/home/mika/Pobrane/phc-intel-pack-rev10# make
Preparing build area for phc-intel-0.3.2:
searching for patch directory... using inc/3.10
copying files
patching file phc-intel.c
SUCCESS. Build area ready.

make -C /lib/modules/`uname -r`/build SUBDIRS=/home/mika/Pobrane/phc-intel-pack-rev10 modules
make[1]: Wejście do katalogu `/usr/src/linux-headers-3.2.0-4-686-pae'
  CC [M]  /home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.o
In file included from /usr/src/linux-headers-3.2.0-4-common/include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:2449:0: warning: "CONFIG_ENABLE_MUST_CHECK" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from /usr/src/linux-headers-3.2.0-4-common/include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:4298:0: warning: "CONFIG_ENABLE_WARN_DEPRECATED" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c: In function ‘extract_msr’:
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:247:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c: In function ‘get_cur_val’:
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:372:22: error: ‘MSR_AMD_PERF_CTL’ undeclared (first use in this function)
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:372:22: note: each undeclared identifier is reported only once for each function it appears in
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c: In function ‘acpi_cpufreq_target’:
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:484:22: error: ‘MSR_AMD_PERF_CTL’ undeclared (first use in this function)
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:506:2: warning: passing argument 1 of ‘cpufreq_notify_transition’ from incompatible pointer type [enabled by default]
In file included from /home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:37:0:
/usr/src/linux-headers-3.2.0-4-common/include/linux/cpufreq.h:255:6: note: expected ‘struct cpufreq_freqs *’ but argument is of type ‘struct cpufreq_policy *’
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:506:2: warning: passing argument 2 of ‘cpufreq_notify_transition’ makes integer from pointer without a cast [enabled by default]
In file included from /home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:37:0:
/usr/src/linux-headers-3.2.0-4-common/include/linux/cpufreq.h:255:6: note: expected ‘unsigned int’ but argument is of type ‘struct cpufreq_freqs *’
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:506:2: error: too many arguments to function ‘cpufreq_notify_transition’
In file included from /home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:37:0:
/usr/src/linux-headers-3.2.0-4-common/include/linux/cpufreq.h:255:6: note: declared here
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:519:2: warning: passing argument 1 of ‘cpufreq_notify_transition’ from incompatible pointer type [enabled by default]
In file included from /home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:37:0:
/usr/src/linux-headers-3.2.0-4-common/include/linux/cpufreq.h:255:6: note: expected ‘struct cpufreq_freqs *’ but argument is of type ‘struct cpufreq_policy *’
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:519:2: warning: passing argument 2 of ‘cpufreq_notify_transition’ makes integer from pointer without a cast [enabled by default]
In file included from /home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:37:0:
/usr/src/linux-headers-3.2.0-4-common/include/linux/cpufreq.h:255:6: note: expected ‘unsigned int’ but argument is of type ‘struct cpufreq_freqs *’
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:519:2: error: too many arguments to function ‘cpufreq_notify_transition’
In file included from /home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:37:0:
/usr/src/linux-headers-3.2.0-4-common/include/linux/cpufreq.h:255:6: note: declared here
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c: In function ‘acpi_cpufreq_cpu_init’:
/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.c:747:2: error: implicit declaration of function ‘policy_is_shared’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[4]: *** [/home/mika/Pobrane/phc-intel-pack-rev10/phc-intel.o] Błąd 1
make[3]: *** [_module_/home/mika/Pobrane/phc-intel-pack-rev10] Błąd 2
make[2]: *** [sub-make] Błąd 2
make[1]: *** [all] Błąd 2
make[1]: Opuszczenie katalogu `/usr/src/linux-headers-3.2.0-4-686-pae'
make: *** [phc-intel.ko] Błąd 2
As a result the module was not created. Now I thought, maybe I should just use a different kernel because 3.2.0 didn't exist in /inc. My another try was with this famous Liquorix kernel (3.9-11). Compiling phc-intel - no problem, make install, but still phc_ files weren't created in /sys/...

Eventually I've downloaded the latest supported version (3.10), compiled again using default Debian config, no problems with make + make install of phc-intel, I can finally see phc_ files in /sys, but lowering values either by using PHCtool or by setting them directly through phc_vids, doesn't change power consumption at all. I can set all of them to some crazy values and nothing happens (on notebook with php-k8 I've got immediate crash after going below some level). It just doesn't seem to work here. Any ideas from a more expierenced users/developers?

lio
Posts: 90
Joined: Wed 2. Mar 2011, 18:37

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by lio » Tue 23. Jul 2013, 19:26

stg20 wrote:

Code: Select all

root@MIKA:/home/mika/Pobrane/phc-intel-pack-rev10# make
Preparing build area for phc-intel-0.3.2:
searching for patch directory... using inc/3.10
As a result the module was not created. Now I thought, maybe I should just use a different kernel because 3.2.0 didn't exist in /inc.
The wrong patch set was used. Please give the new pack a try. It will use the patch set for 3.1 as it is the same for kernel 3.2 up to 3.6.
but lowering values either by using PHCtool or by setting them directly through phc_vids, doesn't change power consumption at all.
What exactly did you test? The lowest VID is fixed for the lowest frequency step on your CPU, you can't get lower, even if phc tells you you can as this is a CPU-limitation and not changeable. However, if on higher frequency steps you don't see any results, than things look fishy.

stg20
Posts: 3
Joined: Tue 23. Jul 2013, 14:20

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by stg20 » Tue 23. Jul 2013, 20:08

lio wrote: The wrong patch set was used. Please give the new pack a try. It will use the patch set for 3.1 as it is the same for kernel 3.2 up to 3.6.


Thank you, with your latest version phc-intel module has been compiled (Debian stock kernel 3.2.0), here's the log:

Code: Select all

root@MIKA:/home/mika/Pobrane/phc-intel-pack-rev10.1# make
Preparing build area for phc-intel-0.3.2:
searching for patch directory... using inc/3.1
copying files
patching file phc-intel.c
SUCCESS. Build area ready.

make -C /lib/modules/`uname -r`/build SUBDIRS=/home/mika/Pobrane/phc-intel-pack-rev10.1 modules
make[1]: Wejście do katalogu `/usr/src/linux-headers-3.2.0-4-686-pae'
  CC [M]  /home/mika/Pobrane/phc-intel-pack-rev10.1/phc-intel.o
In file included from /usr/src/linux-headers-3.2.0-4-common/include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:2449:0: warning: "CONFIG_ENABLE_MUST_CHECK" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from /usr/src/linux-headers-3.2.0-4-common/include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:4298:0: warning: "CONFIG_ENABLE_WARN_DEPRECATED" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/mika/Pobrane/phc-intel-pack-rev10.1/phc-intel.mod.o
In file included from /usr/src/linux-headers-3.2.0-4-common/include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:2449:0: warning: "CONFIG_ENABLE_MUST_CHECK" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from /usr/src/linux-headers-3.2.0-4-common/include/linux/kconfig.h:4:0,
                 from <command-line>:0:
include/generated/autoconf.h:4298:0: warning: "CONFIG_ENABLE_WARN_DEPRECATED" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
  LD [M]  /home/mika/Pobrane/phc-intel-pack-rev10.1/phc-intel.ko
make[1]: Opuszczenie katalogu `/usr/src/linux-headers-3.2.0-4-686-pae'
phc_* files are created as well. I will check if undervolting really works.
lio wrote:What exactly did you test? The lowest VID is fixed for the lowest frequency step on your CPU, you can't get lower, even if phc tells you you can as this is a CPU-limitation and not changeable. However, if on higher frequency steps you don't see any results, than things look fishy.
I'm measuring wattage on each voltage step less, for example my notebook with phc-k8 driver Sempron can work at 2x frequencies: 1.6 Ghz and 800 Mhz. With frequency set to 1.6Ghz I was lowering each time voltage (at 100% CPU usage) and measuring whole notebook power consumption:

1.200V (stock) 46.5 W
1.150V 43.8 W
1.100V 41.5 W
1.050V 39.5 W
1.000V 37.4 W
0.950V 36.1 W

Later on I did the same at lower frequency (800 Mhz, again 100% load):
0.950V (stock) 31.4 W
0.900V 29.8 W
0.850V 28.9 W
0.800V 28.3 W
0.750V 27.5 W

This way I know that phc-k8 is working (lower voltage = lower wattage), but phc-intel with my Intel C2D didn't (wattage was the same on each step). Another thing: on AMD when going below mentioned voltage values, I've eventually got a crash, on PC I could go no matter how much low and no crash enjoyed - that's why I assume it didn't work properly. Unless I'm missing something in power management between Intel and AMD :)

stg20
Posts: 3
Joined: Tue 23. Jul 2013, 14:20

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by stg20 » Wed 24. Jul 2013, 15:19

Just to let you know: your latest version is working properly with 3.2.0.

And exactly just like you said, I can't go lower than the VID value of the lowest frequency. Original VID's: 32 30 28 26, after setting with PHC: 26 26 26 26 (there are 4x frequencies available: 3.00 GHz, 2.66 GHz, 2.33 GHz, 2.00 GHz).

Thank you for help.

lio
Posts: 90
Joined: Wed 2. Mar 2011, 18:37

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by lio » Mon 4. Nov 2013, 10:00

Just updated the package to support kernel 3.12.

ryszardzonk
Posts: 19
Joined: Sat 2. Oct 2010, 14:27

Re: phc-intel 0.3.2 and 0.4.0 + dkms for kernel 2.6.27 to 3.

Post by ryszardzonk » Sun 8. Dec 2013, 11:36

lio wrote:Just updated the package to support kernel 3.12.
Hi lio,

Thank You for your efforts! I have just tried going with kernel 3.12.3. At the same time my distro went up to to GCC 4.8. Newer version of GCC was not a problem with kernel 3.11 where it just spit out more warning but compiled. With 3.12.3 it does not compile anymore. Please take a look at what might be a fault here

Code: Select all

make -C /usr/src/linux SUBDIRS=/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3 phc-k8.ko
make[1]: Wejście do katalogu '/usr/src/linux-3.12.3'
  CC [M]  /usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.o
In file included from include/linux/module.h:17:0,
                 from /usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:37:
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c: In function ‘__check_direct_transitions’:
include/linux/moduleparam.h:349:45: warning: return from incompatible pointer type [enabled by default]
  static inline type *__check_##name(void) { return(p); }
                                             ^
include/linux/moduleparam.h:395:35: note: in expansion of macro ‘__param_check’
 #define param_check_bool(name, p) __param_check(name, p, bool)
                                   ^
include/linux/moduleparam.h:127:2: note: in expansion of macro ‘param_check_bool’
  param_check_##type(name, &(value));       \
  ^
include/linux/moduleparam.h:113:2: note: in expansion of macro ‘module_param_named’
  module_param_named(name, name, type, perm)
  ^
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:65:1: note: in expansion of macro ‘module_param’
 module_param(direct_transitions, bool, 0444);
 ^
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c: In function ‘__check_min_800MHz’:
include/linux/moduleparam.h:349:45: warning: return from incompatible pointer type [enabled by default]
  static inline type *__check_##name(void) { return(p); }
                                             ^
include/linux/moduleparam.h:395:35: note: in expansion of macro ‘__param_check’
 #define param_check_bool(name, p) __param_check(name, p, bool)
                                   ^
include/linux/moduleparam.h:127:2: note: in expansion of macro ‘param_check_bool’
  param_check_##type(name, &(value));       \
  ^
include/linux/moduleparam.h:113:2: note: in expansion of macro ‘module_param_named’
  module_param_named(name, name, type, perm)
  ^
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:68:1: note: in expansion of macro ‘module_param’
 module_param(min_800MHz, bool, 0444);
 ^
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c: In function ‘powernowk8_cpu_init’:
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:1806:23: error: ‘struct cpufreq_driver’ has no member named ‘getavg’
   cpufreq_amd64_driver.getavg = cpufreq_get_measured_perf;
                       ^
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c: At top level:
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:2510:2: error: unknown field ‘owner’ specified in initializer
  .owner  = THIS_MODULE,
  ^
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:2510:2: warning: initialization makes integer from pointer without a cast [enabled by default]
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:2510:2: warning: (near initialization for ‘cpufreq_amd64_driver.flags’) [enabled by default]
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:2510:2: error: initializer element is not computable at load time
/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.c:2510:2: error: (near initialization for ‘cpufreq_amd64_driver.flags’)
scripts/Makefile.build:314: polecenia dla obiektu '/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.o' nie powiodły się
make[2]: *** [/usr/src/patches-kernel/phc/phc-k8_v0.4.5b3/phc-k8.o] Błąd 1
Makefile:1394: polecenia dla obiektu 'phc-k8.ko' nie powiodły się
make[1]: *** [phc-k8.ko] Błąd 2
make[1]: Opuszczenie katalogu '/usr/src/linux-3.12.3'
Makefile:42: polecenia dla obiektu 'phc-k8.ko' nie powiodły się
make: *** [phc-k8.ko] Błąd 2

Post Reply