# Intel Speedstep does not work in 2.6-test11

## ralle

I've got a Pentium III mobile CPU in my Laptop and of course I want to use speedstep in kernel 2.6, which worked perfect with win98 some years ago...

Therefore I configured my kernel like this:

```

  ? ??????????????????????????????????????????????????????????????????????? ?

  ? ?    [*] CPU Frequency scaling                                        ? ?

  ? ?    < >   /proc/cpufreq interface (deprecated)                       ? ?

  ? ?          Default CPUFreq governor (performance)  --->               ? ?

  ? ?    ---   'performance' governor                                     ? ?

  ? ?    <*>   'powersave' governor                                       ? ?

  ? ?    <*>   'userspace' governor for userspace frequency scaling       ? ?

  ? ?    [ ]     /proc/sys/cpu/ interface (2.4. / OLD)                    ? ?

  ? ?    <*>   CPU frequency table helpers                                ? ?

  ? ?    ---   CPUFreq processor drivers                                  ? ?

  ? ?    < > AMD Mobile K6-2/K6-3 PowerNow!                               ? ?

  ? ?    < > AMD Mobile Athlon/Duron PowerNow!                            ? ?

  ? ?    < > AMD Opteron/Athlon64 PowerNow!                               ? ?

  ? ?    < > Cyrix MediaGX/NatSemi Geode Suspend Modulation               ? ?

  ? ?    < > Intel Enhanced SpeedStep                                     ? ?

  ? ?    < > Intel Speedstep on ICH-M chipsets (ioport interface)         ? ?

  ? ?    <*> Intel SpeedStep on 440BX/ZX/MX chipsets (SMI interface)      ? ?

  ? ?    < > Intel Pentium 4 clock modulation                             ? ?

  ? ?    < > Transmeta LongRun                                            ? ?

  ? ?    < > VIA Cyrix III Longhaul                                       ? ?

```

But the needed information is not present in /sys/devices/system/cpu/cpu0, the directory is completely empty.

I compiled my kernel with apm enabled but no acpi, because acpi caused trouble in my old 2.4 kernel in combination with lirc.

Did anybody manage to set up speedstep with this configuration?

----------

## wel

Try this option:

Intel Speedstep on ICH-M chipsets (ioport interface)

The 440 XX interface doesn't work in many *real* laptops, i.e. that with mobile chipsets. Also compile it as a module. I've a mobile p4, it works.

----------

## ralle

OK, I built both the ICH-M and the BX/ZX/MX speedstep module. When I modprobe the ICH-M module, it fails:

```

fry root # modprobe speedstep_ich

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

```

But when I modprobe the BX module, it is successfully loaded:

```

fry root # lsmod

Module                  Size  Used by

speedstep_smi           4352  0

speedstep_lib           2464  1 speedstep_smi

...

```

But even now there is no information in sys:

```

fry linux # ls /sys/devices/system/cpu/cpu0/

fry linux #

```

Anyway I post some info about my cpu, for the case someone still has an idea...

```

fry root # cat /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 8

model name      : Pentium III (Coppermine)

stepping        : 3

cpu MHz         : 697.046

cache size      : 256 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 mmx fxsr sse

bogomips        : 1376.25

```

Maybe this is fixed in the stable kernel...

----------

## wel

It looks like desktop pentium 3. Well, 440bx is the right choice.

Another good advice is: compile ALL as modules. Performance, userspace and powersave governors don't like in-kernel compilation. Try that.

----------

## ralle

It's a mobile PIII, and speedstep worked some years ago when I was still using win98...

Anyway, I tried to compile everything related to speedstep as module, still no luck.

```

fry root # lsmod

Module                  Size  Used by

cpufreq_performance     1472  0

cpufreq_powersave       1280  0

speedstep_smi           4352  0

speedstep_lib           2464  1 speedstep_smi

freq_table              3172  1 speedstep_smi

...

```

```

fry root # ls -la /sys/devices/system/cpu/cpu0/

total 0

drwxr-xr-x    2 root     root            0 Dec 16  2003 .

drwxr-xr-x    3 root     root            0 Dec 16  2003 ..

```

I'll have to check whether it has anything to do with acpi, because I don't have acpi enabled...gotta do that this evening.

----------

## ralle

I've recompiled my kernel with acpi enabled and now dmesg tells me the following:

```

mtrr: 0xf5000000,0x800000 overlaps existing 0xf5000000,0x400000

mtrr: 0xf5000000,0x800000 overlaps existing 0xf5000000,0x400000

speedstep-smi: signature:0x47534943, command:0x008000b2, event:0x000000b3, perf_level:0x07d00100.

speedstep-smi: could not detect low and high frequencies by SMI call.

cpufreq: change failed

speedstep-smi: could not detect two different speeds -- aborting.

```

And again I don't know what the hell went wrong...maybe it's a kernel issue, and I'll just have to wait...

----------

## smiler.se

Seems like your speedstep is special somehow.. 

Does it work under 2.4?

----------

## ralle

I've never tested it under 2.4, because I don't like to patch my kernel. But back in those days when I was still running win98, speedstep worked fine and really seemed to improve the akku capacity. And I just thought I'll give the latest kernel a try...

----------

## grantl

fujitsu-siemens lifebook E-6540, PIII, BX440 Chipset

it has worked with 2.4 kernel (ac-sources) for me but doesn't work with 2.6...i guess i tried all possible kernel configurations

UPDATE: this looks like a good point to start: http://www.poupinou.org/cpufreq/speedstep-piix4.html

It seems that for the PIIX4E southbridge another module is needed in 2.6

i will try to adapt the patch for the development-sources...

----------

## grantl

ok, the patch mentioned above is useable without any change with actual development-sources - but the speedfreq-pii4x module doesnt work on my machine:

"cpufreq: change failed"

I got the SpeedStep Applet from my Fujitsu-Siemens Drivers & Utilities CD and checked the neccessary values for speedstep:

Port=0x000000B2

Command=0x00000082

so i tried 

```
modprobe speedstep-smi smi_port=0xb2 smi_cmd=0x82 
```

which gaves me:

```

Dec 27 03:18:24 netseeker2 speedstep-smi: signature:0x00008680, command:0x0000e6f5, event:0x00000000, perf_level:0x47534943.

Dec 27 03:18:24 netseeker2 speedstep-smi: could not detect low and high frequencies by SMI call.

Dec 27 03:18:24 netseeker2 cpufreq: change failed

Dec 27 03:18:24 netseeker2 speedstep-smi: could not detect two different speeds -- aborting.

```

Don't know how to manage speedfreq on my machine....i guess i will give up   :Crying or Very sad: 

----------

## silverter

Not that this helps much, I'm having the exact same issue on my notebook a Fujitsu Siemens 750 AGP. I haven't managed to get cpufreq working... If you find a solution, don't forget to post it here.

thanks and regards

----------

## fusibou

Did you try compiling the governors in (not modules) + ACPI/APM?

Is there anything you need to enable in BIOS?

----------

## grantl

i have the governors compiled in as well as acpi (which works fine), in bios speedstep behavior is set to "auto". 

with 

```
modprobe speedstep-smi smi_port=0xb2 smi_cmd=0x82 smi_sig=1
```

i get now

```
speedstep-smi: signature:0x00008680, command:0x0000e6f5, event:0x00000000, perf_level:0x47534943.

speedstep-smi: could not detect low and high frequencies by SMI call.

cpufreq: change to 0 MHz succeded

cpufreq: change failed

speedstep-smi: could not detect two different speeds -- aborting.
```

at least the first speed change seems to be successful...

----------

## grantl

yeah finally it works. for me i have to insert, remove and reinsert the speedstep-smi module then it will work. i've to use this command:

```
modprobe speedstep-smi smi_port=0xb2 smi_cmd=0x82 smi_sig=1
```

the first modprobe is located in /etc/modules.autoload/kernel-2.6 and the remove/reinsert in /etc/init.d/cpudyn (i use cpudyn, i guess with the speedstep app it will work similiar):

```

...

checkconfig() {

   #workaround for non-functional cpufreq: it will not work before the module is loaded, unloaded and reloaded - the neccessary first modprobe is located in /etc/modules.autoload/kernel-2.6

   rmmod speedstep-smi

   modprobe speedstep-smi smi_port=0xb2 smi_cmd=0x82 smi_sig=1

   local CPUFREQ_FILES="${CPUFREQ_24} ${CPUFREQ_25} ${CPUFREQ_ACPI}"

   local CPUFREQ_FILE=""

   for i in ${CPUFREQ_FILES}; do [ -e ${i} ] && CPUFREQ_FILE="${i}" && break ; done

   if [ -z "${CPUFREQ_FILE}" ]; then

      eerror "Neither CPUFreq nor ACPI throttling support were found"

      return 1

   fi

   if [ "${CPUFREQ_FILE}" = "${CPUFREQ_ACPI}" ]; then

      # see if the file says we are supported or not

      grep 'not supported' ${CPUFREQ_ACPI} 2>&1 >/dev/null

      retval="$?"

      if [ $retval -eq 0 ]; then

         eerror "ACPI throttling support found, but hardware doesn't support it"

         return 1

      fi

      # now check that we can write to the file

      local acpistate=`grep 'active state' ${CPUFREQ_ACPI} | cut -dT -f2-`

      echo $acpistate > ${CPUFREQ_ACPI}

      retval="$?"

      if [ $retval -ne 0 ]; then

         eerror "Writing to ACPI throttling file failed"

         return 1

      fi

   fi

}

...

stop() {

   #workaround for non-functional cpufreq workaround: we have to remove and  reinsert the module because a later start() will do so too and the module will only work with every second insert

        rmmod speedstep-smi

        modprobe speedstep-smi smi_port=0xb2 smi_cmd=0x82 smi_sig=1

   ebegin "Stopping cpudynd"

   start-stop-daemon --stop --quiet --pidfile $PIDFILE \

      --exec $DAEMON && rm -f $PIDFILE

   eend $?

}

```

does this solution work for anyone else too?

----------

## silverter

Thanks for posting your solution; I'm about to try it out on my notebook. But before I start strugling with my kernel options, can you post the relevant ACPI related options of your kernel config? Until now I had only APM compile in my kernel since ACPI will now work for my notebook... but that was a while ago and since then I haven't tried it with the latest kernel releases.

thanks and regards,

----------

## grantl

 *silverter wrote:*   

> ...But before I start strugling with my kernel options, can you post the relevant ACPI related options of your kernel config?

 

sure, here they are:

```

#

# Power management options (ACPI, APM)

#

CONFIG_PM=y

CONFIG_SOFTWARE_SUSPEND=y

# CONFIG_PM_DISK is not set

#

# ACPI (Advanced Configuration and Power Interface) Support

#

CONFIG_ACPI=y

CONFIG_ACPI_BOOT=y

CONFIG_ACPI_INTERPRETER=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_TOSHIBA is not set

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_BUS=y

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_PCI=y

CONFIG_ACPI_SYSTEM=y

CONFIG_ACPI_RELAXED_AML=y

CONFIG_X86_PM_TIMER=y

#

# APM (Advanced Power Management) BIOS Support

#

# CONFIG_APM is not set

#

# CPU Frequency scaling

#

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=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_24_API=y

CONFIG_CPU_FREQ_TABLE=y

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y

# 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 is not set

CONFIG_X86_SPEEDSTEP_SMI=m

CONFIG_X86_SPEEDSTEP_LIB=m

# CONFIG_X86_P4_CLOCKMOD is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

```

i have had problems with acpi compiled as modules so i compiled it in the kernel...

hope this helps.

----------

## silverter

Thanks, will be testing and posting my results here...

regards,

----------

## ralle

Thanks, now it works for me, but only if I insert the module for the FIRST time (which is ok).

I can change speed by typing 

```

echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
```

I've got APM but no ACPI, is there a way of changing the speed when (un-)plugging the ac?

speedfreq, cpudynd and cpufreqd do not work for me, but I still have to look up the reasons...

Nevertheless I'd prefer an apmd script.

----------

## ralle

Here is a simple script for those of you using apm. It changes the cpu speed when (un-)plugging the ac. Just put it in /etc/apm/event.d and make sure /etc/init.d/apmd ist started:

```

#!/bin/sh

STATE=`cat /proc/apm | cut -d " " -f 4 | tr -d "%"`

if [ "$1,$2" = "change,power" ]; then

    if [ "$STATE" = "0x00" ]; then

        echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    fi

    if [ "$STATE" = "0x01" ]; then

        echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    fi

fi

```

Have Fun!

----------

## onan

hi, I suggest you to use acpi if apm does not work at all. 

I had problem with both but I solved the problem with acpi by tweaking the /etc/init.d/speedfreq script

```

check_acpi() {

   [ "${SPEEDFREQ_SPEED}" == "auto" ] || return 0

   [ ! -f /proc/acpi/battery/BAT0/state ] && return 0

   local status="`echo $(cat /proc/acpi/battery/BAT0/state | grep charging | cut -c 26-)`"

   echo ${status}

   case ${status} in

      charging)      SPEEDFREQ_SPEED=1500;;

      discharging)   SPEEDFREQ_SPEED=600;;

      *)            SPEEDFREQ_SPEED=1500;;

   esac

}

start() {

   check_acpi

   ebegin "Starting speedfreq at ${SPEEDFREQ_SPEED}MHz"

   /usr/sbin/speedfreqd -P -p ${SPEEDFREQ_SPEED} ${SPEEDFREQ_OPTS}

   eend $?

}

```

maybe you should take a look at that script

I'm using a IBM R40

hope it could help you :)

----------

## Flintz

I have the same issue, /sys/devices/system/cpu/cpu0 is an empty directory on my system. 

I have a Siemens-Fujitsu Lifebook with a P3 M 750 on a 440MX chipset.

Is this still the only solution:

http://www.poupinou.org/cpufreq/speedstep-piix4.html

Or is there any new workaround now?

Oh and does cpufreqd work with this solution? Because I really like it's features!

***EDIT***

Sorry for doubleposting, plz look for further discussion:

https://forums.gentoo.org/viewtopic.php?t=230956

----------

