PHC Patch Installs No Files

If you have trouble with PHC you can ask and hope for help here.
Post Reply
lukechanning
Posts: 8
Joined: Sun 6. Jun 2010, 18:21

PHC Patch Installs No Files

Post by lukechanning » Sun 6. Jun 2010, 18:40

Howdy, everyone! I really hope you can help me with this, as I very much need to undervolt my Macbook (runs a bit hot and battery life is awful in Kubuntu) and this has been driving me crazy.
I've been trying to install PHC using this guide ( http://openmindedbrain.info/09/05/2010/ ... lucid-lts/ ). I'll skip the details of installing the kernel, as I simply followed the directions to the T--look at the site if you'd like to know exactly what I did. Loading the kernel works like a charm (I did NOT have to mess with GRUB to boot, or anything of that sort, worked right out of the box), and I can download and install the patch without issue. My only problem is that the patch doesn't appear to be installing anything!
My cpu0/cpufreq have no phc_ files of any sort, and running modprobe phc-intel returns a fatal: Not found error. I have run make prepare/make/make install what feels like a hundred times under every different situation I can think of, but still it doesn't seem to install anything. Help with this would be much appreciated, as without undervolting I'm afraid the Macbook battery life just isn't up to par with what I'd like, and I'll have to leave my beloved KDE and go back to Mac Os X. And nobody wants that! :)

More detailed install info:
Running a Macbook 3,1 with Intel CoreDuo, Kubuntu Lucid LTS. Using phc-intel-0.3.2-10 offtree, extracted to my documents folder and installed under root, returns this (from start to finish):

root@Kubook:~# cd /home/lukepatrick/Documents/phc-intel
root@Kubook:~/Documents/phc-intel# make clean
rm -f *~ *.o *.s *.ko *.mod.c .*.cmd *.rej *.c *.c.orig Module.symvers Module.markers modules.order
rm -rf .tmp_versions
root@Kubook:~/Documents/phc-intel# make prepare
FOUND AVAILABLE PATCHSET. PREPARING.
patching file phc-intel.c
root@Kubook:~/Documents/phc-intel# make
make -C /lib/modules/`uname -r`/build SUBDIRS=/home/lukepatrick/Documents/phc-intel modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-22-generic-phc'
CC [M] /home/lukepatrick/Documents/phc-intel/phc-intel.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/lukepatrick/Documents/phc-intel/phc-intel.mod.o
LD [M] /home/lukepatrick/Documents/phc-intel/phc-intel.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-22-generic-phc'
root@Kubook:~/Documents/phc-intel# make install
install -m 644 -o root -g root phc-intel.modprobe /etc/modprobe.d/phc-intel.conf
mkdir -p /lib/modules/2.6.32.11+drm33.2/extra
install -m 644 -o root -g root phc-intel.ko /lib/modules/2.6.32.11+drm33.2/extra/
depmod 2.6.32.11+drm33.2 -a
root@Kubook:~/Documents/phc-intel#

Checking the CpuFreq files returns this:

root@Kubook:~# cat /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids
cat: /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids: No such file or directory

Interestingly, running modprobe phc-intel returns a not found, but when I list the directory, the files is there:

root@Kubook:~/Documents/phc-intel# ls /etc/modprobe.d/
alsa-base.conf blacklist-bcm43.conf blacklist-firewire.conf blacklist-modem.conf blacklist-watchdog.conf
blacklist-ath_pci.conf blacklist.conf blacklist-framebuffer.conf blacklist-oss.conf phc-intel.conf


Sorry for the wealth of (un)important information, but I wanted to be as precise as I could. Anybody have any ideas? As stated, I'd love for this to work, and this is the only step in the way, really! :D

the-fallen
Administrator
Posts: 346
Joined: Wed 9. Jul 2008, 19:57

Re: PHC Patch Installs No Files

Post by the-fallen » Sun 6. Jun 2010, 19:32

Strange, but try "modprobe acpi-cpufreq". This should be an alias for phc-intel.
If that does not work, too you can also insert a module "manually" (just to give you a working system until we know whats your problem) using insmod (sudo insmod /path/to/module/phc-intel.ko).

After "make install" you may need to reboot your system or at least unload the old acpi-cpufreq and load the new one to get it to worn instantly.

lukechanning
Posts: 8
Joined: Sun 6. Jun 2010, 18:21

Re: PHC Patch Installs No Files

Post by lukechanning » Sun 6. Jun 2010, 22:19

Okay, I did as instructed, and we've made a slight amount of progress, which is hopeful. Running the "alias" version of phc-intel returned a not found error, so I tried the manual install. That, to the best of my knowledge, appeared to work. Cheers! :) But when I tried to run the new mod, this is what I got:

root@Kubook:~/Documents/phc# modprobe acpi-cpufreq
FATAL: Module phc_intel not found.
FATAL: Error inserting acpi_cpufreq (/lib/modules/2.6.32-22-generic-phc/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko): Device or resource busy
FATAL: Error running install command for acpi_cpufreq

So. . . Still not great, but it looks more like what others are seeing as far as errors go! :D I'm gonna restart my mac and see what comes of that, but if you don't hear back from me via another post, you can assume that everything is still knackered. Thanks so much for your help!

Update:
So good news is that I can run a cat check on phc_default_vids and get number strings in return, and the whole slew of phc_ files are now in cpu0 after running the manual install. All of this is with the above error, in fact. The bad news is that, after restarting my computer, all of the necessary files were nuked from cpu0, and I had to do the install all over again. Is this normal? Regardless, I'm going to continue with the process, and hope for the best. Thanks again!

Here's a little bit more terminal info for you to peruse if you like:


root@Kubook:~/Documents/phc# modprobe acpi-cpufreq
FATAL: Module phc_intel not found.
FATAL: Error inserting acpi_cpufreq (/lib/modules/2.6.32-22-generic-phc/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko): Device or resource busy
FATAL: Error running install command for acpi_cpufreq
root@Kubook:~/Documents/phc# cat /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids
31 28 25 22 18 7
root@Kubook:~/Documents/phc# ls /sys/devices/system/cpu/cpu0/cpufreq
affected_cpus ondemand phc_version scaling_cur_freq scaling_setspeed
cpuinfo_cur_freq phc_controls phc_vids scaling_driver
cpuinfo_max_freq phc_default_controls related_cpus scaling_governor
cpuinfo_min_freq phc_default_vids scaling_available_frequencies scaling_max_freq
cpuinfo_transition_latency phc_fids scaling_available_governors scaling_min_freq
root@Kubook:~/Documents/phc#

lukechanning
Posts: 8
Joined: Sun 6. Jun 2010, 18:21

Re: PHC Patch Installs No Files

Post by lukechanning » Mon 7. Jun 2010, 02:56

Okay, I've hit the end of the road, but everything is at least working now. Using the manual install I could put all the necessary files in place, and I was able to successfully configure phc_vids. The change is quite drastically, and I'm very pleased; my laptop doesn't get as hot, or stays at a constant temperature when taxed, and it's not a stretch to think my battery life is improved. So all is well :) Of course, this could all be placebo, although I don't think it is. Still, is there anyway to check and be 100% sure that PHC is "doing its thing?" I think I saw a terminal command for this somewhere, but I've lost it since.
And I say I've hit the end of the road, because everytime I restart my computer, I have to manually reinstall the mod and then configure the PHC_VIDS file, which is a bit of pain. Is there anyway around this? I could do like everyone else and set up a script for my configurations, but the Phc_X Files themselves disappear with each restart, and I don't *believe* that's the same thing. Please correct me if I'm wrong. Is there any way around having to manually reinstall phc_intel.ko? A more permanent fix would be unbelievably cool.
Anywho, thanks for all the help, as I'm pretty sure everything is working at the moment. Thanks, and cheers! :)

the-fallen
Administrator
Posts: 346
Joined: Wed 9. Jul 2008, 19:57

Re: PHC Patch Installs No Files

Post by the-fallen » Mon 7. Jun 2010, 15:57

Sounds like your modules are not loaded at system boot. Thats okay... you are running Ubuntu.
You have two possibilities:

1 - insert the module to /etc/modules

2 - install cpufreq-utils. It is a script that automatically loads the necessary modules at startup. It was part of the Ubuntu system until 9.04.


To check if PHC is doing his work you can use read_msr (available in a PHC-Forum near you :) ).

Use read_msr to read the current MSR (register output) and compare if your settings are really applied to the CPU.

To check the temperature you can use "acpi -t" (needs package acpi) or any other system tool that is able to read CPU temperature (like sensors)

lukechanning
Posts: 8
Joined: Sun 6. Jun 2010, 18:21

Re: PHC Patch Installs No Files

Post by lukechanning » Mon 7. Jun 2010, 19:47

Again, thank you so much for your continued help :) But on to business!
According to KpackageKit, I already have cpufreq-utils installed. It seems to think I installed it along with the phc kernel, which I believe that guide did have me do. Regardless, I went ahead and modified /etc/modules. I just inserted the line "phc-intel" into the document. Will that be sufficient to load the module on boot?
The read-msr returned some interesting results. According to the readout, 31 is the highest VID my laptop is reaching for, and 18 is the lowest. I find this strange, since my phc_vid settings were: 18 14 12 11 10 7. Also, it feels like my laptop is getting hot again, even when I only have Chrome open and nothing else; behaviour I saw more out of my pre-undervolting attempt usage. Anywho, here is the readout from read-msr. Hopefully I'm interpreting it wrong, as PHC doesn't seem to be affecting my system. :(

lukepatrick@Kubook:~/Downloads/read_msr.py$ sudo ./read_msr.py --readmsr
MSRTOOL V0.2pre-3 started...

[cpu0] [CURRENT] FID:10 HID:0 DID:0 VID:18
[cpu0] [TARGET] FID:8 HID:1 DID:0 VID:7
[cpu0] [HIGHEST] FID:10 (HID:0 DID:0) VID:31 (not sure if they exist here)
[cpu0] [LOWEST] FID:6 (HID:0 DID:0) VID:18 (not sure if they exist here)
[cpu0] [SLFM] FID:8 VID:7
[cpu0] [IDA] FID:11 VID:39
[cpu0] [CURRENTLY ACTIVE FEATURES] IDA:64 EIST:1

[cpu1] [CURRENT] FID:10 HID:0 DID:0 VID:18
[cpu1] [TARGET] FID:10 HID:0 DID:0 VID:18
[cpu1] [HIGHEST] FID:10 (HID:0 DID:0) VID:31 (not sure if they exist here)
[cpu1] [LOWEST] FID:6 (HID:0 DID:0) VID:18 (not sure if they exist here)
[cpu1] [SLFM] FID:8 VID:7
[cpu1] [IDA] FID:11 VID:39
[cpu1] [CURRENTLY ACTIVE FEATURES] IDA:64 EIST:1

the-fallen
Administrator
Posts: 346
Joined: Wed 9. Jul 2008, 19:57

Re: PHC Patch Installs No Files

Post by the-fallen » Mon 7. Jun 2010, 22:10

About the highest and lowest ... thats okay.
I was not sure those values really mark the highest and lowest values.
Intel does not provide many documentation... unfortunately.

You are right, the ppa-Kernel does depends on cpufreq-util... but I was not sure you are using that kernel.
So it is strange that the module is not loaded (at least that is what I guess).

You wrote that your cpu starts to get hot again? Do you know that you need to set the VIDs each time you restart the PC/Laptop?

You can use a script to set your values automatically at startup. Write your own or use one of those vailable in the forum.

lukechanning
Posts: 8
Joined: Sun 6. Jun 2010, 18:21

Re: PHC Patch Installs No Files

Post by lukechanning » Wed 9. Jun 2010, 17:09

So, I feel like a total boob, but I figured out what the entire problem is/was.
I recently did an entire wipe of Kubuntu and reinstall of Ubuntu (got tired of the KDE desktop, just a personal preference), and I thought I'd try installing PHC with a fresh go. During the installation of the patch, I noticed that it reached a point in the terminal dialog where it says "Done", and then sits for a while. I seem to remember seeing this the first go round and thinking, "Oh, it must have hung in installation, so I'll just kill the terminal and move on." This, of course, means I probably shafted the installation, but since it had already installed the kernel, I never noticed. :S Then entire problem was that I"m an impatient idiot. lol
The fresh install worked without a hitch, and I can definitely notice a change in my laptop temperature/battery life. Thank you so much for this tool, and for your help! When I have more data, I will definitely put up a success story write-up. Thanks again!

the-fallen
Administrator
Posts: 346
Joined: Wed 9. Jul 2008, 19:57

Re: PHC Patch Installs No Files

Post by the-fallen » Thu 10. Jun 2010, 19:24

Hey,

thats no problem. We all are doing our mistakes each day. But it is good to know that you was able to fix your "problem" and con now enjoy your work with Linux.

Post Reply