# can't load speedstep_ich on p4m machine

## hess

Hi,

I have a Mobile Pentium 4 2.80 GHz CPU and an ICH4 southbridge, which means I should be able to use the speedstep_ich cpufreq driver.  However, when I try to insert the speedstep_ich module, I get an error:

```

krusty hess # modprobe speedstep_ich

FATAL: Error inserting speedstep_ich (/lib/modules/2.6.14-gentoo-r2/kernel/arch/i386/kernel/cpu/cpufreq/speedstep-ich.ko): No such device

```

I'm not quite sure why this happens.  I've reverted to using the acpi_cpufreq driver, but I'm not sure it scales the processor's voltage correctly, since my CPU runs pretty hot (60-70+ C), even when I'm not doing anything computationally expensive.  I've had this problem with other distros, too.

If anyone can offer any advice, I'd really appreciate it.

-Rob

----------

## feivelda

You must compile the speedstep_ich and the p4-clockmod as module.

But you can't use the acpi_cpufreq driver then.

I think, you loaded the acpi_cpufreq or the p4-clockmod driver before the speedstep_ich module.

This causes such an error.

A little hint from me.

On my P4Mobile 1.6 GHz, I can adjust frequency and voltage.

This is done by two little scripts and it saves my a lot of power when I'm on battery mode.

I can post them, if you want, in maybe 10 hours, I'm currently at work

----------

## hess

All are compiled as modules.  I've tried loading speedstep_ich without loading any other speedstep modules, and the above error is the result.  I've tried putting speedstep_ich in /etc/modules.autoload.d with no success.

I assume you're successfully using the speedstep_ich driver?

I'm just using cpufreqd to control frequency, but I'd be interested to see the scripts you're using.

----------

## feivelda

Can you post the part CPU Frequency Scaling in your config file

I will post mine when I'm at home

----------

## hess

Here it is:

```

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=y

# CONFIG_CPU_FREQ_STAT_DETAILS is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=m

CONFIG_X86_SPEEDSTEP_CENTRINO=m

CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y

CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y

CONFIG_X86_SPEEDSTEP_ICH=m

CONFIG_X86_SPEEDSTEP_SMI=m

CONFIG_X86_P4_CLOCKMOD=m

```

----------

## feivelda

I would only set the CONFIG_X86_SPEEDSTEP_ICH and CONFIG_X86_P4_CLOCKMOD

This should be enough

----------

## hess

 *feivelda wrote:*   

> I would only set the CONFIG_X86_SPEEDSTEP_ICH and CONFIG_X86_P4_CLOCKMOD
> 
> This should be enough

 

That shouldn't matter.  Since the drivers are all compiled as modules, I can choose to load whichever I want.

Also, note that p4-clockmod doesn't actually do frequency/voltage scaling.  It just inserts idle CPU cycles to help keep the processor cool.  See here.

----------

## feivelda

I know that, but you can combine both by first setting the voltage and after that the frequency.

Also I know that on all threads were I have said this before, nobody thinks this works, but I've made test when on battery and both together is much more effective than one of them alone ( When on battery I'm running with lower voltage and 600 MHz )

I will post my .config and the two scripts plus the acpi script when I'm at home.

You can test it at your own then.

----------

## feivelda

So, my kernel config is

```
#

# Power management options (ACPI, APM)

#

CONFIG_PM=y

# CONFIG_PM_DEBUG is not set

# CONFIG_SOFTWARE_SUSPEND is not set

CONFIG_SUSPEND2_CRYPTO=y

#

# ACPI (Advanced Configuration and Power Interface) Support

#

CONFIG_ACPI=y

# CONFIG_ACPI_SLEEP is not set

CONFIG_ACPI_AC=m

CONFIG_ACPI_BATTERY=m

CONFIG_ACPI_BUTTON=m

CONFIG_ACPI_VIDEO=m

# CONFIG_ACPI_HOTKEY is not set

CONFIG_ACPI_FAN=m

CONFIG_ACPI_PROCESSOR=m

CONFIG_ACPI_THERMAL=m

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_IBM is not set

# CONFIG_ACPI_TOSHIBA is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_SYSTEM=y

# CONFIG_X86_PM_TIMER is not set

# CONFIG_ACPI_CONTAINER is not set

#

# APM (Advanced Power Management) BIOS Support

#

# CONFIG_APM is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=m

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=m

CONFIG_CPU_FREQ_STAT_DETAILS=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=m

CONFIG_CPU_FREQ_GOV_POWERSAVE=m

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=m

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

#

# CPUFreq processor drivers

#

# CONFIG_X86_ACPI_CPUFREQ is not set

# CONFIG_X86_POWERNOW_K6 is not set

# CONFIG_X86_POWERNOW_K7 is not set

# CONFIG_X86_POWERNOW_K8 is not set

# CONFIG_X86_GX_SUSPMOD is not set

# CONFIG_X86_SPEEDSTEP_CENTRINO is not set

CONFIG_X86_SPEEDSTEP_ICH=m

# CONFIG_X86_SPEEDSTEP_SMI is not set

CONFIG_X86_P4_CLOCKMOD=m

# CONFIG_X86_CPUFREQ_NFORCE2 is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

#

# shared options

#

CONFIG_X86_SPEEDSTEP_LIB=m

# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
```

And my two scripts

First force_performance

```
#!/bin/bash

/sbin/modprobe -r p4-clockmod

/sbin/modprobe speedstep_ich

cpufreq-set -g performance

/sbin/modprobe -r speedstep_ich

/sbin/modprobe p4-clockmod
```

and force_powersave

```
#!/bin/bash

/sbin/modprobe -r p4-clockmod

/sbin/modprobe speedstep_ich

cpufreq-set -g powersave

/sbin/modprobe -r speedstep_ich

/sbin/modprobe p4-clockmod
```

----------

## hess

What is the output of `cat /proc/cpuinfo` on your machine?  What about `cpufreq-info`?

----------

## feivelda

```
dog /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model           : 2

model name      : Intel(R) Pentium(R) 4 Mobile CPU 1.60GHz

stepping        : 4

cpu MHz         : 448.728

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

bogomips        : 2395.43
```

```
cpufreq-info

cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004

Report errors and bugs to linux@brodo.de, please.

analyzing CPU 0:

  driver: p4-clockmod

  CPUs which need to switch frequency at the same time: 0

  hardware limits: 150 MHz - 1.20 GHz

  available frequency steps: 150 MHz, 300 MHz, 450 MHz, 600 MHz, 750 MHz, 900 MHz, 1.05 GHz, 1.20 GHz

  available cpufreq governors: powersave, performance, ondemand, conservative, userspace

  current policy: frequency should be within 150 MHz and 1.20 GHz.

                  The governor "ondemand" may decide which speed to use

                  within this range.

  current CPU frequency is 450 MHz (asserted by call to hardware).
```

----------

## hess

Ok, if I turn on cpufreq debugging, I get the following debug messages when I try to load the speedstep_ich driver:

```

speedstep-lib: x86: f, model: 4

speedstep-ich: Intel(R) SpeedStep(TM) capable processor not found

```

Here is a snippet of code from speedstep-lib.c:

```

unsigned int speedstep_detect_processor (void)

{

        ...

        dprintk("x86: %x, model: %x\n", c->x86, c->x86_model);

        ...

        if (c->x86 == 0xF) {

                /* Intel Mobile Pentium 4-M

                 * or Intel Mobile Pentium 4 with 533 MHz FSB */

                if (c->x86_model != 2)

                        return 0;

        ...

}

```

For some reason, speedstep_detect_processor() returns 0 (failure) for my processor model.  Your processor, on the other hand, is family 15 (0xf), model 2, and so it passes the above test.

I know my processor is speedstep capable.  If I `cat /proc/cpuinfo`, the est (enhanced speedstep) flag is present.  Speedstepping also works fine under WinXP.  I wonder why model 2 is the only processor in family 15 allowed to use the kernel's speedstep drivers.

----------

## feivelda

Have you tried different kernel versions?

If this doesn't help it would be the best to paste this question at the kernel mailing list

----------

## hess

In the end, I've settled for using the acpi-cpufreq driver.  According to the members of the cpufreq mailing list, that is the correct driver for my processor.

----------

## raf

I have a p4m in a Dell Inspiron 8500 laptop. RIght now I only use speedstep compiled into the kernel, and use cpudyn to control the frequency (min, max, and dynamic). I can also use throttling to slow down my system, but I don't know if it actually saves any power or if it keeps my system cooler:

```
echo -n 4 > /proc/acpi/processor/CPU0/throttling
```

QUESTIONS:

Enabling p4 clock modulation will insert idle clock cycles. Will this be done automatically when the module is loaded when the processor gets too hot?

If so, does that mean I've been running my CPU hotter then it should have been for the last while?

How will processor load affect the clock modulation? What takes more priority, heat or performance? I mean, how hot is too hot?

If I want more performance is it safe to unload the p4 clock modulation? 

Does anyone use the throttling I mentioned above? This seems like a manual form of the clock modulation.

I would like three settings for my laptop:

Minimum performance and maximum battery life: Used for work excel, text, on the road.

Dynamic performance: I'm on AC, doing usual stuff. Internet, compiling, etc. I would like this to scale to full performance when needed. If i'm compiling something give me full speed so I can continue to work on  on other things, but don't burn my house to the ground.

Constant maximum performance: Full CONSTANT performance. Good for gaming as I definitely don't want dynamic scaling there.

Thanks

----------

## hess

I've learned a lot about cpufreq investigating the question I originally started this thread with.  Let me see if I can answer some of your questions.

 *Quote:*   

> 
> 
> Enabling p4 clock modulation will insert idle clock cycles. Will this be done automatically when the module is loaded when the processor gets too hot?
> 
> 

 

To automatically perform clock modulation, you either need to use a userspace cpu scaling program like cpufreqd or cpudyn, or else load one of the kernel's cpufreq governors that dynamically scale the processor.  'conservative' and 'ondemand' are two such governors.

 *Quote:*   

> 
> 
> If so, does that mean I've been running my CPU hotter then it should have been for the last while?
> 
> How will processor load affect the clock modulation? What takes more priority, heat or performance? I mean, how hot is too hot?
> ...

 

The answers to these questions depend on what governors or scaling programs you are currently using.

 *Quote:*   

> 
> 
> If I want more performance is it safe to unload the p4 clock modulation? 
> 
> 

 

You could unload p4clockmod, but I'd be careful about doing this without loading one of the cpufreq drivers that scales the processor's frequency/voltage (probably acpi-cpufreq or one of the speedstep drivers in your case).  I've had problems with my processor getting too hot too fast when I don't use any of the cpufreq drivers.

 *Quote:*   

> 
> 
> Does anyone use the throttling I mentioned above? This seems like a manual form of the clock modulation.
> 
> 

 

From what I understand, ACPI throttling is just an alternative to cpufreq scaling for people whose processor doesn't support scaling.

 *Quote:*   

> 
> 
> I would like three settings for my laptop:
> 
> Minimum performance and maximum battery life: Used for work excel, text, on the road.
> ...

 

Check out this page: http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap3.  There's a lot of good info there on cpu power management, as well as tips on other ways to save battery life on your laptop.  Currently, I'm using cpufreqd to do scaling for me.  It pretty easily does everything you say you want to do, and it's in Portage.  I think cpufreqd's generally more robust than cpudyn.

I hope this is helpful

----------

## raf

Thanks for the info. I am currently running cpudyn. However, I guess my question is should I be running p4 clock modulation ALONG with my speedstep? ie should BOTH be running as they do different things?

----------

## hess

You can only load one or the other at any given time.  According to feivelda above, it is possible to use both at the same time, by simply loading one, then unloading it and loading the other,  but I am sceptical about that.  I'd say the better option is to use the speedstep driver, since that should save you a bunch of battery life and will, in my experience, keep your cpu just about as cool as p4clockmod does, or cool enough, anyway.  p4clockmod won't save any battery life, and might end up actually decreasing it.

There's currently some talk on the cpufreq mailing list about enabling the kernel to use a modulation driver and a scaling driver at the same time, but that's probably a ways off.Last edited by hess on Thu Dec 08, 2005 3:14 am; edited 2 times in total

----------

## raf

Great, thanks. That's what I've been doing. Speedstep + cpudyn and nothing else. BTW you might also want to try laptop-tools. It's a way to spin down your drive when not needed. Great way to save battery life.

----------

## feivelda

In last time I ran my CPU at 1.2 GHz and at sometimes then decrease the speed to 750 MHz. Together with the i8krellm I have wonderful 46 °C with 750 MHz and 53 °C under 1.20 MHz.

If you want to avoid heat, a switch to powersave when you have loaded speedstep_ich is the best way. Throttling on a high voltage can't get the temperature as low.

I would be interested if raf test the scripts, if the longer battery run is only subjective or really objective measurable. I've no second pentium4 mobile to test this

@hess: It first load the speedstep_ich to set the powersave govenor, this lower's the supply voltage of the cpu. After that it unloads the driver and loads the frequency scaling driver. The lower voltage isn't changed at this point. On my p4m I have a frequency range from 1.6 GHz down to 200 MHz in 200 MHz steps when I'm on high supply voltage and 1.2 GHz down to 150 MHz in 150 MHz steps when I'm on lower supply voltage.

----------

## hess

@feivelda: I was trying to test your scripts manually to see if they do make a difference in core tmperature, but once I had one of the driver modules loaded, I couldn't remove it:

```
# modprobe -r acpi_cpufreq

FATAL: Module acpi_cpufreq is in use.
```

Do you do anything special to allow yourself to remove the modules?

----------

## feivelda

No, but I use speedstep_ich and p4-clockmod, not acpi_cpufreq

----------

