# CPUfreq governors keep getting stuck on lowest speed

## widremann

I have a Pentium-M (on a ThinkPad T43) and it can run between 800 MHz and 2 GHz.  I have the cpufreq governor set to "ondemand" which works most of the time.  That is, it will throttle down to 800 MHz when not much activity is going on, but will ramp up to 2 GHz when needed.  However, sometimes, it will get stuck where it will only stay on 800 MHz and won't ramp up, no matter what.  In fact, cpufreq-info starts saying that the limit is 800 MHz to 800 MHz, when before it said 800 MHz to 2.0 GHz.  I have to restart cpufreqd, sometimes multiple times, in order to get it back to the full range.  Why is it doing this?

----------

## jomen

it has gotten a bit long, but might help anyway...

I'm not using cpufreqd like you - because it is not doing anything useful for me that could not be done with just the drivers and the sysfs-interface...

but I had a similar problem a few days ago, when I upgraded my kernel to 2.6.15-gentoo.

All I'm interested in is the frequency changing to low whenever it is not needed to be high...

The same symptoms - and I got it solved...by a little black magick I suppose - I still do not know, what exactly did the trick to make it work again. 

Now it is working as it should.

What I did:

checked my kernel-config - I had: Default CPUFreq governor (performance)

I changed that to: Default CPUFreq governor (userspace)

and compiled 'performance' governor and 'powersave' governor in the kernel - as well as:

'ondemand' cpufreq policy governor - under 'userspace' governor for userspace frequency scaling

also I had: Intel Enhanced SpeedStep - compiled in

and: Use ACPI tables to decode valid frequency/voltage pairs - compiled in

and: Built-in tables for Banias CPUs - compiled in

I changed this last thing to NOT be included after reading the help-file and doing, what it suggested.

This might have caused my trouble - but I changed the other things as well and so I'm telling you about them as well

before that I did not have 'powersave' governor - because I did not want or need it

and did not have Default CPUFreq governor (userspace) - it was working fine with: ...performance

I switch my frequency through sysfs directly without a daemon by having this line in /etc/conf.d/local.start:

```
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
```

----------

## widremann

Well, I did turn off cpufreqd and I'm trying to set the cpu frequency manually with cpufreq-set, but even then, it randomly decides to go back to being stuck on 800 MHz.  I even tried making a little while loop in bash which keeps resetting it every 3 seconds and that stops working until I cancel the while loop and start it again!  There's no rhyme or reason to when and why it resets and when it actually lets me set the value manually (many times, it just ignores my request to set the value).  So I'm at a loss to figure out why it's being such a pain and the ass, but it really is.  And I'd like to be able to compile KDE 3.5 sometime before the end of the universe, but if the CPU keeps throttling down, it will take a lot longer to finish.

----------

## jomen

 *Quote:*   

> So I'm at a loss to figure out why it's being such a pain and the ass, but it really is.

 

Thats why I wrote all this - because I had the same issue - and now it is gone.

So you might go check your current kernels configuration - and if its like mine was, not like it is now - consider trying to change the things I changed - one of which made it work again

(probably - but I'm just guessing - because I had this enabled and should'nt have: Built-in tables for Banias CPUs).

I have to add, that I was using a 2.6.14 kernel whith which it was working - the same options however, did not work on the new 2.6.15 - that is why I changed them and now it works.

This is all I can say about this - hope it will help you - I don't even want to figure out, why I had this issue then - but have it not anymore. I'm just happy that it works again.

----------

## widremann

Well, I tried those things and it still keeps getting stuck on the lowest setting.  I wrote a one line bash script which constantly tries to reset the CPU frequency to 2 GHz, but it keeps resetting itself back to 800 MHz after a while (and then eventually will allow to be switched back to 2 GHz and then the cycle repeats).  Why is this happening?  It's not so much that it sets it to a lower frequency it's that it starts saying the maximum frequency is 800 MHz and it won't let me manually set the frequency, or the maximum frequency, back to 2 GHz.  I mean, wtf?

----------

## jomen

If the choices you made while configuring your kernel are really correct (keeping an eye on the things I suggested), the only thing I could think of is: it might be the fault of cpufreqd, which you seem to be running.

Why don't you for a try disable this daemon - and do without it - eighter by manually echoing the gouvernor to sysfs or by doing this via the init-scripts, like I've described.

I'm not sure how cpufreqd works - probably by writing to the same locations as if you would do it by hand - depending on your CPU-load - but it works just as well without it. And if it does not work with it - it might work, when leaving this possible source of error out...

----------

## zaai

I've run into the same problem.

My approach is the same as Jomen describes, kernel compiled with performance, powersave, ondemand governors. cpufreqd is not installed and enabled the ondemand governor in /etc/conf.d/local.start, just like Jomen describes.

This approach did work for kernel 2.6.12 but since upgrading to 2.6.14 it works spotty. Eg, it might work when starting firefox or emerging, but it also might not.

My processor is an AMD64 though and the system is compiled for Pentium3-32bit (acting as binhost for p3 laptop).

I think its a bug somewhere because it sometimes works, but have no idea where to look for it.

----------

## jomen

For me it was working flawlessly with 2.6.14-gentoo-r5 - but I had different kernel-config-options then. ( I started with this kernel - newly installed system on my new laptop) 

Problem started with 2.6.15-gentoo - but it works now - flawlesly as before.

----------

## kristoffer

I'm having the same problem (or at least a very similar one) as per this thread.

I tried what jomen suggested, i.e. disabling Built-in tables for Banias CPUs in my kernel (currently 2.6.16-suspend2-r8 which basically is gentoo-souces with the suspend2 patches applied to it), and it did not work. I'm just wondering if any progress has been made for those of you who experienced the same problem but where jomen's fix didn't work.

----------

