Pentium M kernel 3.7 on archlinux no voltage controls

If you have trouble with PHC you can ask and hope for help here.
Post Reply
Posts: 1
Joined: Thu 28. Feb 2013, 16:26

Pentium M kernel 3.7 on archlinux no voltage controls

Post by jukilonolo » Sat 2. Mar 2013, 12:23

Hello to all,I have istalled phc driver correctly but It doesn't work,there are no voltage control...I read that Pentium M cpus don't work well with phc on 3.x kernels, is that possible? O.o
On windows I have no problem undervolting the cpu...
Thank you very much

uname -r

Code: Select all

cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family   : 6
model      : 13
model name   : Intel(R) Pentium(R) M processor 1.80GHz
stepping   : 6
microcode   : 0x18
cpu MHz      : 1800.000
cache size   : 2048 KB
fdiv_bug   : no
hlt_bug      : no
f00f_bug   : no
coma_bug   : no
fpu      : yes
fpu_exception   : yes
cpuid level   : 2
wp      : yes
flags      : fpu vme de pse tsc msr mce cx8 apic sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss tm pbe bts est tm2
bogomips   : 3574.47
clflush size   : 64
cache_alignment   : 64
address sizes   : 32 bits physical, 32 bits virtual
power management:

Code: Select all

# lsmod |grep phc
phc_intel              14512  1
mperf                   1024  1 phc_intel
processor              24552  2 phc_intel

Code: Select all

# ls /sys/devices/system/cpu/cpu0/cpufreq/
affected_cpus               phc_rawcontrols                scaling_driver
bios_limit                  phc_version                    scaling_governor
cpuinfo_max_freq            phc_vids                       scaling_max_freq
cpuinfo_min_freq            related_cpus                   scaling_min_freq
cpuinfo_transition_latency  scaling_available_frequencies  scaling_setspeed
phc_default_rawcontrols     scaling_available_governors
phc_default_vids            scaling_cur_freq

Code: Select all

cat /sys/devices/system/cpu/cpu0/cpufreq/*
cat: /sys/devices/system/cpu/cpu0/cpufreq/phc_default_rawcontrols: No such device
cat: /sys/devices/system/cpu/cpu0/cpufreq/phc_default_vids: No such device
cat: /sys/devices/system/cpu/cpu0/cpufreq/phc_rawcontrols: No such device
cat: /sys/devices/system/cpu/cpu0/cpufreq/phc_vids: No such device
1800000 1600000 1400000 1200000 1000000 800000 600000
conservative ondemand performance

Posts: 4
Joined: Sat 4. May 2013, 02:18

Re: Pentium M kernel 3.7 on archlinux no voltage controls

Post by zorg » Sat 4. May 2013, 02:40

I am having the exact same problem on Debian Squeeze, both with a Debian stock kernel (3.2, backported to Squeeze) and a 3.9 kernel that I compiled today. - I assume that some people have been successful with 3.x kernels. - It would be extremely helpful to hear from someone who made it work: which kernel, how they buildt the module etc.. I've been relying on linux-phc for years, it has been a great help, but now, for me at least, it seems to stop working at kernel version 2.6.39 . I've been using the phc-intel-pack-rev8 and rev9 . Pentium M735.
:( :? :shock: :cry:

Posts: 73
Joined: Wed 2. Mar 2011, 18:37

Re: Pentium M kernel 3.7 on archlinux no voltage controls

Post by lio » Sun 5. May 2013, 19:36

Some previous kernel (3.0?) changed the way this CPU (and other single core processors) are handled so phc does not work anymore for those. If you apply and it should work again. However, I never tried it by myself, just read about people who tried and lived long enough to report about it. ;)


Posts: 4
Joined: Sat 4. May 2013, 02:18

Re: Pentium M kernel 3.7 on archlinux no voltage controls

Post by zorg » Tue 7. May 2013, 21:24

Hi lio,
thanks very much for your comments, they put me on the right track to compile a working phc-enabled kernel 3.9.0 .
Though it is important to note that only should be applied wich amounts to replacing just one line in the file source-directory/drivers/acpi/processor_core.c, namely
if (cpuid == -1)
if ((cpuid == -1) && (num_possible_cpus() > 1))

After I had the patch numbers I found this message on the web (
Comment by sh__ 2011-08-11 13:08
It seems kernel 3.0 has some issues with uniprocessor / single-core machines. This patch seems to be the culprit:
I got phc-intel working on Pentium M by patching the kernel with an old patch:

I found this still to be the correct recipe. :D

Posts: 4
Joined: Sat 4. May 2013, 02:18

Pentium M no voltage controls

Post by zorg » Mon 7. Aug 2017, 10:12

This thread is referred to in the README.1st that's part of the current phc-intel download. Unfortunately the patch mentioned in the previous posts turns out to have been just a temporary fix.

I ran into trouble when I was upgrading my operating system and tried to also upgrade my kernel from version 3.12: intel-phc compiles and loads but voltage controls are non-functional for kernel 3.16 or newer. I then started browsing the sources of the longterm linux kernels.

patch 106696 changes one line in a subroutine called "init processor_physically_present" in the source file drivers/acpi/processor_core.c . However, this subroutine is moved to drivers/acpi/processor_pdc.c in kernel 3.18 . The patched line - "if (cpuid == -1)" - still exists at this point but was removed between kernel versions 4.1 and 4.4 .

I then tried to make phc_intel work with kernel 3.16 but didn't manage that either: the patch can be applied, the "processor" and "phc_intel" modules both compile and load but otherwise the situation is exactly as described in the first post in this thread: although the phc files exist in /sys/devices/system/cpu/cpu0/cpufreq/ they are not accessible: cat phc_vids returning "No such device" etc.

I took another look at the post accompanying patch 786962 (link in the previous post) that started all this mess at the inception of kernel 3.0. It says that the patch was introduced "so both UP and
SMP kernel use the same acpi_get_cpuid function" . This takes me back to the fact that phc_intel is still working even with the latest kernels for at least some multicore CPUs . So why not for unicore CPUs? Patch 106696 was supposed to be the answer to that. But it isn't. - What is?

Posts: 4
Joined: Sat 4. May 2013, 02:18

Good News

Post by zorg » Sun 20. Aug 2017, 01:46

After some experimentation I'm happy to report that much of my previous post was mistaken. ;) I've been able to make linux-phc work for Kernel 3.16.46, 4.1.43 and 4.12.8 on a Thinkpad T42 with Dothan Pentium M processor:
Linux Kernel 3.16.46
Just apply the previously mentioned patch to drivers/acpi/processor_core.c. My mistake that led to the previous post was to then just recompile the acpi drivers (using "make M=drivers/acpi") for a stock kernel I was using. This threw up no errors and resulted in a perfectly working kernel. But linux-phc didn't work. It only did when I compiled the whole kernel after applying the patch. (And that is what I did in 2013 as I belatedly remembered.)
Linux Kernel 4.1.43
The patch applies to a subroutine called "init processor_physically_present" which now appears in the file drivers/acpi/processor_pdc.c (right at the beginning of that file). Edit that file and replace the line
if (cpuid == -1)
if ((cpuid == -1) && (num_possible_cpus() > 1))
Then compile the kernel.
Linux Kernel 4.12.8
processor_pdc.c is almost unchanged relative to Kernels 4.1.x, unfortunately one of the two lines that are changed is the one that is replaced by the patch, namely: it's gone. So what I did was replace the processor_pdc.c file with the - edited! - processor_pdc.c taken from Kernel 4.1.43, hoping for the best. And that works.

I've been having problems using the current rev24 of linux-phc, namely the Makefile error
Kernel version not found, maybe you need to install appropriate kernel-headers or run make with KERNELSRC parameter, e.g.: make KERNELSRC=/usr/src/linux)
has been a constant, and the explicit setting of KERNELSRC has only sometimes helped. One time running 'make' in the phc-intel-pack-rev24 directory resulted in the linked kernel source being recompiled,

Therefore, since I need to compile the kernel anyway, it's been much easier for me to go the respective include directory, e.g. .../phc-intel-pack-rev24/inc/3.16/, there to make a backup of the acpi_cpufreq.c file, then run
patch -l -p0 < linux-phc-0.3.2.patch
and copy the patched acpi_cpufreq.c to drivers/cpufreq/ in the kernel source tree to overwrite the unpatched acpi_cpufreq.c file there. Consequently there is no phc_intel module with the compiled kernel but an acpi_cpufreq module that has the phc_intel module's properties.

I've been trying to attach the patched processor_core.c and processor_pdc.c files to this post but apparently I'm not allowed.

Post Reply