Some cpufreq modules are not loaded automatically yet

Bug #8200 reported by Manuel Teira
66
Affects Status Importance Assigned to Milestone
powernowd (Ubuntu)
Fix Released
Medium
Thom May

Bug Description

It goes from negative numbers to the range of thousand of Ghz (my machine is
700Mhz maximum).
I've seen that the problem is that the speedstep-smi module was not loaded.
Perhaps a hotplug problem?
Anyway, perhaps the random behaviour could be corrected.

After modprobing speedstep-smi, the frequency gets fixed at 700Mhz. Even if I
disconnect the AC power, it gets in 700Mhz. Perhaps this is a powernowd issue now.

I'm testing with a Thinkpad A21m. Pentium III Mobile 700 Mhz (it has two speed
steps: 550 and 700 Mhz ).

Revision history for this message
Matt Zimmerman (mdz) wrote :

powernowd will probably fail to start if the necessary modules are not loaded,
however, it tries to load each cpufreq module in sequence until one succeeds, so
this should have loaded speedstep-smi. Please send dmesg output, lsmod output
(after a clean boot), and any messages that you see from the powernowd
initialization process (you can retry with "/etc/init.d/powernowd start" after
boot in order to capture the messages)

Revision history for this message
Manuel Teira (manuel-teira) wrote :

Created an attachment (id=108)
dmesg log

dmesg output after clean reboot

Revision history for this message
Manuel Teira (manuel-teira) wrote :

Created an attachment (id=109)
lsmod output after clean reboot

This is the lsmod output after a clean reboot

Revision history for this message
Manuel Teira (manuel-teira) wrote :

below is the output of powernowd, when trying to start from command line:
Powernow is not starting. However, when I start using /etc/init.d/powernow
start, it says everything is ok, but it doesn't start.

After manually modprobing speedstep-smi, it starts fine. But then, the gnome
applet is not able to show any frequency change. However, in /proc/cpuinfo I can
see the frequency changes. I need to restart the gnome-applet to get it to work
correctly after starting powernowd.

$ sudo /usr/sbin/powernowd -d
PowerNow Daemon v0.90, (c) 2003-2004 John Clemens
Found 1 cpu:
Couldn't open file: No such file or directory
Couldn't open file: No such file or directory
Couldn't open file: No such file or directory
couldn't open govn's file for writing: No such file or directory
Couldn't get per-cpu data: Illegal seek
PowerNowd encountered and error and could not start.
Please make sure that:
 - You are running a v2.5/v2.6 kernel or later
 - That you have sysfs mounted /sys
 - That you have the core cpufreq and cpufreq-userspace
   modules loaded into your kernel
 - That you have the cpufreq driver for your cpu loaded,
   and that it works. (check dmesg for errors)
If all of the above are true, and you still have problems,
please email the author: <email address hidden>

Revision history for this message
knackko (knackko) wrote :

in order to powernowd works, try to init cpufreqd .

if you do not have /etc/init.d/cpufreqd to start, install it ('aptg-get install
cpufreqd' after refreshing the mirrors)

do echo 'speedstep-smi >> /etc/modules' in order to load the module at start up.

Revision history for this message
knackko (knackko) wrote :

(In reply to comment #5)
> in order to powernowd works, try to init cpufreqd .
>
> if you do not have /etc/init.d/cpufreqd to start, install it ('aptg-get install
> cpufreqd' after refreshing the mirrors)
>
> do echo 'speedstep-smi >> /etc/modules' in order to load the module at start up.

echo speedstep-smi >> /etc/modules

sorry

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #0)
> It goes from negative numbers to the range of thousand of Ghz (my machine is
> 700Mhz maximum).

Can you still make gnome-frequency-applet do this?
If so, can you send me the output of /sys/devices/system/cpu/cpu0/cpufreq/* whilst
this is ocurring?

Revision history for this message
Manuel Teira (manuel-teira) wrote :

Now, the range is between zero and a lot of Ghz.
The directory /sys/devices/system/cpu/cpu0/cpufreq/ does not exists.
I think that the problem is that powernowd is not loading the speedstep-smi
module. When that module is loaded manually (say, adding it to /etc/modules)
everything works fine.
Shouldn't that module be loaded automatically by hotplug or powernowd?

Revision history for this message
Nuno Ferreira (nuno-ferreira) wrote :

This also happened to me. In my case, I needed to load p4-clockmod manually to
get powernowd to work.
I think the problem is that /etc/init.d/powernowd is trying to load the modules
from /lib/modules/`uname -r`/kernel/drivers/cpufreq but they are in
/lib/modules/`uname -r`/kernel/arch/i386/kernel/cpu/cpufreq

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #9)
> This also happened to me. In my case, I needed to load p4-clockmod manually to
> get powernowd to work.
> I think the problem is that /etc/init.d/powernowd is trying to load the modules
> from /lib/modules/`uname -r`/kernel/drivers/cpufreq but they are in
> /lib/modules/`uname -r`/kernel/arch/i386/kernel/cpu/cpufreq

Nope, sorry. We load the drivers from drivers/cpufreq (ie, the governors to let
cpufreq work correctly)
then we check /etc/default/powernowd to see if the user has specified a cpufreq
type (eg, p4-clockmod), try and load that,
and then load "acpi" as a fall back.
echo "FREQDRIVER=p4-clockmod"|sudo tee -a /etc/default/powernowd
to enable the functionality you need.

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 9055 has been marked as a duplicate of this bug. ***

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 9017 has been marked as a duplicate of this bug. ***

Revision history for this message
Matt Zimmerman (mdz) wrote :

mjg59 mentioned during the Hoary kickoff meeting that Paul Sladen was working on
some code for this:

Oct 25 11:42:06 <mdz> " Automatic /cpufreq module loading (possibly for
desktop systems, too)"
Oct 25 11:42:16 <mjg59> Sladen was working on that
Oct 25 11:42:31 <mdz> I think the path forward for that is hotplug cpu
support, is it not?
Oct 25 11:42:34 <mjg59> It's straightforward - just need to map CPU to module,
and then fall back to acpi
Oct 25 11:43:02 <mdz> mjg59: what was he working on? loading the right module
based on /proc/cpuinfo?
Oct 25 11:43:07 <mjg59> mdz: Yes
Oct 25 11:43:08 <thom> mdz: yes
Oct 25 11:43:23 <mdz> ok, sounds eminently doable for hoary

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 9912 has been marked as a duplicate of this bug. ***

Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 9889 has been marked as a duplicate of this bug. ***

Revision history for this message
Matt Zimmerman (mdz) wrote :
Revision history for this message
Matt Zimmerman (mdz) wrote :

*** Bug 10205 has been marked as a duplicate of this bug. ***

Revision history for this message
Sidnei da Silva (sidnei) wrote :

I would like to help getting this working on the powerpc platform. I have a
first-generation iBook and a Pismo Powerbook.

I've tried powernowd on both and none of them worked. It looks like cpufreq is
compiled to use the 2.4 api, and powernowd doesn't cope with that.

sidnei@cotia:~$ cat /boot/config-2.6.7-powerpc | grep CPU_FREQ
\CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_PROC_INTF=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_24_API=y
CONFIG_CPU_FREQ_PMAC=y
CONFIG_CPU_FREQ_TABLE=y

Revision history for this message
Matt Zimmerman (mdz) wrote :

The relevant wiki page has moved to:

http://www.ubuntulinux.org/wiki/CPUFreqModuleLoading

Revision history for this message
Etienne Goyer (etienne-goyer-outlands) wrote :

(In reply to comment #5)
> in order to powernowd works, try to init cpufreqd .
>
> if you do not have /etc/init.d/cpufreqd to start, install it ('aptg-get install
> cpufreqd' after refreshing the mirrors)

Should'nt the powernowd package depend on cpufreqd then ? Just a thought ...

Revision history for this message
Matt Zimmerman (mdz) wrote :

No, powernowd doesn't require cpufreqd (it provides similar functionality).

Regarding the original bug, I believe it has since been fixed:

powernowd (0.90-3ubuntu2) hoary; urgency=low

  * Use Paul Sladen's driver detection script.

 -- Thom May <email address hidden> Thu, 16 Dec 2004 12:56:11 +0000

Thom?

Revision history for this message
Eric Schwartz (emschwar-ericschwartz) wrote :

This used to work for me, but as of about two weeks ago, I started getting "CPU
Frequency Scaling not supported" messages when I log into GNOME. When I tried
to start powernowd manually, I got the same error messages as in comment #4.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #22)
> This used to work for me, but as of about two weeks ago, I started getting "CPU
> Frequency Scaling not supported" messages when I log into GNOME. When I tried
> to start powernowd manually, I got the same error messages as in comment #4.

Send a copy of your /proc/cpuinfo, and let us know which is the correct CPU
frequency scaling driver for your CPU (the one which worked before)

Revision history for this message
Paul Sladen (sladen) wrote :

Hello Eric,

If you've done an upgrade in the last couple of weeks, this may have been
combined with Thom uploading the extra detection code.

This this case that may have adversely affected things; or maybe there's some
other change such as an ACPI rev in the kernel if you've been trying Matthew's
extra suspend goodness.

As Matt says, can you send a copy of:

  cat /proc/cpuinfo > cpuinfo-eric.txt

and also:

  sudo apt-get install dmidecode
  sudo dmidecode > dmi-decode-output-eric.txt

and upload/attach/email those two files.

Many Thanks,
    -Paul

Revision history for this message
Eric Schwartz (emschwar-ericschwartz) wrote :

For the life of me I cannot remember which cpufreq driver I was using in the
past, but I know I had one, because the CPU was idling at 1.2MHz, and running at
1.7 when doing strenuous activities, like oggencode or the like. I'll upload my
cpuinfo and dmidecode output in a second.

Revision history for this message
Eric Schwartz (emschwar-ericschwartz) wrote :

Created an attachment (id=1004)
Contents of /proc/cpuinfo

Revision history for this message
Eric Schwartz (emschwar-ericschwartz) wrote :

Created an attachment (id=1005)
output of dmidecode

Revision history for this message
Paul Sladen (sladen) wrote :

Hi Eric,

The cpufreq for your P4-M, I think is:

  sudo modprobe speedstep-centrino

can you try and confirm if it does/doesn't work (if it does, we'll add the
signature to the detection so that it works for other people).

 -Paul

Revision history for this message
Matthew Trent (t3rmin) wrote :

Just a note that my CPU isn't properly handled by the module loading script (in
/usr/share/powernowd). I've got an AMD Mobile Sempron. It does support frequency
scaling via the powernow-k8 module:

powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09b)
powernow-k8: 0 : fid 0x8 (1600 MHz), vid 0x6 (1400 mV)
powernow-k8: 1 : fid 0x0 (800 MHz), vid 0x18 (950 mV)
powernow-k8: cpu_init done, current fid 0x8, vid 0x6

and here's /proc/cpuinfo (it's scaled to 1/2 speed here):
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 8
model name : Mobile AMD Sempron(tm) Processor 2800+
stepping : 2
cpu MHz : 800.430
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext 3dnowext 3dnow
bogomips : 1585.15

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #29)
> Just a note that my CPU isn't properly handled by the module loading script (in
> /usr/share/powernowd). I've got an AMD Mobile Sempron. It does support frequency
> scaling via the powernow-k8 module:

I've uploaded a new module with the signature for your processor added - please
give this a try and see how you go.

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #25)
> For the life of me I cannot remember which cpufreq driver I was using in the
> past, but I know I had one, because the CPU was idling at 1.2MHz, and running at
> 1.7 when doing strenuous activities, like oggencode or the like. I'll upload my
> cpuinfo and dmidecode output in a second.

Can you try the current powernowd package and see if detection now works for you?

Revision history for this message
Eyal Oren (ikbeneyal) wrote :

Hi,

I'm not sure whether the problem isn't on my side, but since a couple of weeks
cpu freq. scaling also doesn't work for me anymore.
I get "FATAL: Error inserting speedstep_centrino
(/lib/modules/2.6.10-1-686/kernel/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.ko):
No such device" when trying to start powernowd. I think speedstep-centrino is
the right module though for my processor, looking in you detection script.

Output of /proc/cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz
stepping : 9
cpu MHz : 1196.466
cache size : 512 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 pae mce cx8 sep mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips : 2359.29
(In reply to comment #31)
> (In reply to comment #25)
> > For the life of me I cannot remember which cpufreq driver I was using in the
> > past, but I know I had one, because the CPU was idling at 1.2MHz, and running at
> > 1.7 when doing strenuous activities, like oggencode or the like. I'll upload my
> > cpuinfo and dmidecode output in a second.
>
> Can you try the current powernowd package and see if detection now works for you?

Revision history for this message
Matt Zimmerman (mdz) wrote :

Perhaps there is a kernel issue here, and the module loaded successfully under
earlier kernels?

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #33)
> Perhaps there is a kernel issue here, and the module loaded successfully under
> earlier kernels?

Previously they would have been loading the "acpi" module. It's entirely
possible that the centrino module doesn't (yet) support the processor.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #34)
> (In reply to comment #33)
> > Perhaps there is a kernel issue here, and the module loaded successfully under
> > earlier kernels?
>
> Previously they would have been loading the "acpi" module. It's entirely
> possible that the centrino module doesn't (yet) support the processor.

Did that driver go away? I don't see a module by that name in current kernels.

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #35)
> (In reply to comment #34)
> > (In reply to comment #33)
> > > Perhaps there is a kernel issue here, and the module loaded successfully under
> > > earlier kernels?
> >
> > Previously they would have been loading the "acpi" module. It's entirely
> > possible that the centrino module doesn't (yet) support the processor.
>
> Did that driver go away? I don't see a module by that name in current kernels.

It appears to have been renamed to acpi-cpufreq, a rather more reasonable (or at
least, less generic) name.

I guess we could try loading the module we select, and then if it fails, print
an error, then try loading acpi-cpufreq.

Revision history for this message
Paul Sladen (sladen) wrote :

To try and answer the last three;

cpufreq-centrino (should probably be 'cpufreq-enhanced-speedstep'). For older
chip generations this has the speed/voltage pairs hardcoded in the driver
source, but for newer ones (and models advertising speedstep2 that it doesn't
know about), the driver relies on the ACPI _PSS tables from the DSDT. If this
is buggy, the driver fails with a note saying that it doesn't have correct
tables for the chip.

The cpufreq-acpi driver is just called 'acpi.ko' but should probably be renamed
to the former since currently it is abiguous. Ubuntu has ACPI compiled into the
kernel, so 'modprobe acpi' should get the cpufreq driver. Previously, the
powernowd package just tried loading all the cpufreq-* drivers and saw which
ones 'stuck' (didn't fail to load). --See fourth suggestion at end.

The third option is the driver known as 'speedstep-smi'; This uses the SMI
interface to System Management Mode (SMM) which consists of writing a known
value to a special port. Normally this value/port combo is saved from a 16-bit
int 0x15 call to the BIOS in the Linux setup.S code. I have some code (not in
my repositary yet) for finding the value/port by grepping the BIOS for the IST
magic+table and seems to work in more cases. This corrected information then be
passed to 'speedstep-smi' as 'smi_cmd=' and 'smi_port='.

Instead of just ''trying them all'', we're trying to hit the nail on the head
first time; perhaps it'd be an option to start adding fallbacks;

  test "$suggested_module" = "speedstep-centrino" && modprobe speedstep-centrino
|| modprobe acpi

The approach that seems to be taken by ''other operating systems'' is to fall
straight back to the SMI interface, frequently with hard-coded vales for the
smi_port/smi_cmd in the override file in known non-functioning or problematic cases.

Because of this, I'm starting to believe that SMI cpufreq interface is probably
more reliable in more cases---and to perhaps consider falling back to this more
quickly. Data needs to start coming in (hardware-database) before we can start
making statistics about what is more likely to work.

  -Paul

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

I have a /proc/cpuinfo of

processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 12
model name : AMD Athlon(tm) 64 Processor 3000+
stepping : 0
cpu MHz : 2043.205
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 pni syscall nx mmxext lm 3dnowext 3dnow
bogomips : 4005.88
TLB size : 1088 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

which isn't recognised (cat /proc/acpi/processor/CPU0/info gives me

processor id: 0
acpi id: 0
bus mastering control: no
power management: no
throttling control: no
limit interface: no

powernowd from dmesg gives me

powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09e)
powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
powernow-k8: 1 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
powernow-k8: 2 : fid 0x2 (1000 MHz), vid 0x12 (1100 mV)
cpu_init done, current fid 0xc, vid 0x2

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #38)
> I have a /proc/cpuinfo of
>
> processor : 0
> vendor_id : AuthenticAMD
> cpu family : 15
> model : 12
> model name : AMD Athlon(tm) 64 Processor 3000+
> stepping : 0
> cpu MHz : 2043.205
> cache size : 512 KB
> fpu : yes
> fpu_exception : yes
> cpuid level : 1
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
> pat pse36 clflush mmx fxsr sse sse2 pni syscall nx mmxext lm 3dnowext 3dnow
> bogomips : 4005.88
> TLB size : 1088 4K pages
> clflush size : 64
> cache_alignment : 64
> address sizes : 40 bits physical, 48 bits virtual
> power management: ts fid vid ttp
>
> which isn't recognised (cat /proc/acpi/processor/CPU0/info gives me
>
> processor id: 0
> acpi id: 0
> bus mastering control: no
> power management: no
> throttling control: no
> limit interface: no
>
> powernowd from dmesg gives me
>
> powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09e)
> powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
> powernow-k8: 1 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
> powernow-k8: 2 : fid 0x2 (1000 MHz), vid 0x12 (1100 mV)
> cpu_init done, current fid 0xc, vid 0x2

That looks correct - your processor simply doesn't support frequency scaling.

Revision history for this message
Matthew Garrett (mjg59) wrote :

No, it looks like it has frequency scaling, but it's using cpufreq rather than
ACPI to obtain it. In that case, it's normal for there to be less information in
/proc/acpi

Revision history for this message
Thom May (thombot) wrote :

This bug is rather less than useful now; I *think* I've got all the cases on here

Revision history for this message
Jens Weiss (jens-weiss) wrote :

Created an attachment (id=3149)
CPU Info

My ACPI fucntion on my Laptop does not work correctly.
My Laptop is a Acer Extensa 2300 with a Intel Celeron M Prozessor.

Revision history for this message
Jens Weiss (jens-weiss) wrote :

Created an attachment (id=3150)
Dmesg Message after boot m system

Revision history for this message
Sarangan Thuraisingham (sarangan-thuraisingham) wrote :

After upgrade to Breezy, my cpu frequency scaling doesn't work anymore. Then I
modprobed p4-clockmod but now my CPU scales down from 2.66GHz to 2.33GHZ and
thats it. Before the idle frequency was 333 MHz. After spending the whole day on
it, I ruled out powernowd problems. The problem seems to be in p4-clockmod
scaling-driver.
  # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    2333275 2666600

So the problem is that powernow is being told that my CPU only has two available
frequencies.Also my "/sys/devices/system/acpi/acpi0" is empty, does this matter?

Thanks in advance.

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #44)
> After upgrade to Breezy, my cpu frequency scaling doesn't work anymore. Then I
> modprobed p4-clockmod but now my CPU scales down from 2.66GHz to 2.33GHZ and
> thats it. Before the idle frequency was 333 MHz. After spending the whole day on
> it, I ruled out powernowd problems. The problem seems to be in p4-clockmod
> scaling-driver.
> # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
> 2333275 2666600
>
> So the problem is that powernow is being told that my CPU only has two available
> frequencies.Also my "/sys/devices/system/acpi/acpi0" is empty, does this matter?
>
> Thanks in advance.
>

This is a different issue; please file a separate bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.