Lenovo Thinkpad T430s/T430u/T430 Power Management: tp_smapi, hdaps, thinkpad_ec

I have recently bought myself Thinkpad T430s [Model 2356] (last time I had Thinkpad was the T43) and on a quest to perfect it under my primary OS i.e. OpenSUSE.

So, the system current is:


 linux-2z4y:/home/vg # uname -a
 Linux linux-2z4y.site 3.4.28-2.20-desktop #1 SMP PREEMPT Tue Jan 29 16:51:37 UTC 2013 (143156b) x86_64 x86_64 x86_64 GNU/Linux
 

There are two issues I want to deal with, as everything else works out of box without any issues:

  1. To make the tp_smapi and hdaps to work:
    The tp_smapi kernel module exposes some features of the ThinkPad hardware/firmware via a sysfs interface. Currently, the main implemented functionality is control of battery charging and extended battery status. It also includes an improved version of the HDAPS driver. The underlying hardware interfaces are SMAPI and direct access to the embedded controller.

This will help to much better manage the batteries (6-cell + UltraBay 3-cell) and use the Active Protection for HDD (though I am planning to update in future with mSATA SSD and SSD 7mm).

  1. To make the built-in Fingerprint scanner work
    (Bus 001 Device 003: ID 147e:2020 Upek)

On this thread I would like to talk about the first one (for second issue another thread).

So, right after installing fresh openSUSE 12.2 system updated I checked if tp_smapi and hdaps are present which were not:


 # lsmod|egrep 'hdaps|thinkpad_ec|tp_smapi'
(no results meaning the modules are not loaded)
 

I went and did a 1-click install of the package (software.opensuse.org:) which includes the hdaps as well. I chose the latest 0.41 version from home:munix9 and the package tp_smapi-kmp-desktop (as you can see from above that is the kernel I am runnig).

The packages were installed and accounted for as one can see from below:


 linux-2z4y:/home/vg # ls /lib/modules/3.4.28-2.20-desktop/updates/
 hdaps.ko  thinkpad_ec.ko  tp_smapi.ko
 

So I checked again, after rebooting, and it is still not present. Then I tried to load the modules manually:


 linux-2z4y:/home/vg # modprobe tp_smapi
 FATAL: Error inserting tp_smapi (/lib/modules/3.4.28-2.20-desktop/updates/tp_smapi.ko): No such device or address
 linux-2z4y:/home/vg # modprobe tp_smapi hdaps
 FATAL: Error inserting tp_smapi (/lib/modules/3.4.28-2.20-desktop/updates/tp_smapi.ko): No such device or address
 linux-2z4y:/home/vg # modprobe hdaps
 FATAL: Error inserting hdaps (/lib/modules/3.4.28-2.20-desktop/updates/hdaps.ko): No such device or address
 

So I am stuck and wondering what have I done wrong/missing, as the three needed modules are present at /lib/modules/3.4.28-2.20-desktop/updates/

Any help and tips would be much appreciated. If we do it successfully then I can update the Hardware Portal of openSUSE for this notebook with relative info.

You may have installed more than one tp_smapi kernel module rpm. I never use the “1-click install”. It has a tendency of installing more than one rpm.
I always recommend copying the link and adding it to Software Repositories.

Please check in Yast Software Management.
For autoloading the modules. You will also have to open Yast–> System → /etc/sysconfig Editor -->System → Kernel → MODULES_LOADED_ON_BOOT

Type in: tp_smapi

Click on the OK buttons to complete your entry. You must reboot.

I found a link that is related to tp_smapi with openSUSE 11.1

Follow Up

After burning up google for some time it looks like a lot of people are experiencing the same problem
with this error message after running " modprobe tp_smapi ".


FATAL: Error inserting tp_smapi (/lib/modules/3.4.28-2.20-desktop/updates/tp_smapi.ko): No such device or address  
linux-2z4y:/home/vg # modprobe tp_smapi hdaps  
FATAL: Error inserting tp_smapi (/lib/modules/3.4.28-2.20-desktop/updates/tp_smapi.ko): No such device or address  
linux-2z4y:/home/vg # modprobe hdaps  
FATAL: Error inserting hdaps (/lib/modules/3.4.28-2.20-desktop/updates/hdaps.ko): No such device or address

Please have a look at the link below:

linrunner.de: TLP – Linux Advanced Power Managementhttps://build.opensuse.org/package/show?package=tlp&project=home%3Ajluce2%3Atlp

You can try a different repository to see if there is any difference - must be v0.41

I would like to see other Thinkpad users chime in on this.

Owing to firmware differences of my SL series TP (btw same for IdeaPads), tp_smapi doesn’t support them afaik. No reason to play with it. :slight_smile:

I wouldn’t even call them “the 1-click install”, there are lots of them, and no way to really know what they do to your system.

According to the ArchLinux website, if you are installing on a recent Thinkpad that has an Ivy Bridge processor (X230, T430, T530, etc.), tp_smapi will not work. Use tpacpi-bat.

Download and install the rpm package " tlp ". Add this repository to Yast http://download.opensuse.org/repositories/home:/jluce2:/tlp/openSUSE_12.2/

It provides several bash scripts that will control battery charging and power management for your T430s laptop. A number of users are satisfied with its functionality.
You must use konsole or xterm. There is no gui for this application.

Thanks for the the tips; I will definetely check the tpacpi_bat and read about it. Have been also checking the ArchWiki (https://wiki.archlinux.org/index.php/Tp_smapi), seems like they are most active implementers of tp_smapi.

In the meantime I checked Yast–> System → /etc/sysconfig Editor -->System → Kernel → MODULES_LOADED_ON_BOOT and it is empty; after reading your post I am guessing even if I load the modules on boot by typing them there, which I tried manually it will result the same ERROR while booting.

Maybe the new kernel 3.7 (sadly not 3.8) that will be rolling out with openSUSE 12.3 has better with newer features of ACPI implementation!

T430’s are not even mentioned on the tp_smapi page at ThinkWiki (almost a year since page updated), and the project page at sourceforge (nothing new said for 4+ years there) refers back to ThinkWiki for information. It seems once again that ArchWiki site is best for most useful and up to date technical tips, not only for ThinkPads, but other drivers e.g. graphics.

Agreed. I would recommend subscribing to the tp_smapi dev mail list and ask about the status. Most likely they are working on it.

You could submit a Bugzilla report about tp_smapi not supporting Ivy-Bridge cpus.

Hi all,
I was having issues with high power usage on my new T430 (20-24W) and came across this thread. Just wanted to let you know that the problem was traced to the nVidia card being enabled at all times. I fixed the problem by installing Bumblebee (https://wiki.debian.org/Bumblebee). I am running Debian but I guess it would be possible to compile it for Suse. Anyway, power consumption is now down to 10-12W.
I hope this helps.
Regards,
jcrosso

Bumblebee has been with openSUSE for some time. See Bumblebee for openSUSE.

If you decide to run bumblebee all you need to do is to make sure you are in the “bumblebee” group and that bumblebee is started on boot.
To get bumblebee started on boot run the following command as “su -”:

systemctl enable bumblebeed.service

You have a Thinkpad with an Ivy Bridge Processor, tp_smapi will not work then please use thinkpad-acpi.
For information, please refer to Tp smapi - ThinkWiki

I’m afraid you are going to need a kernel 3.9 and higher. Unfortunately, as you may have read on Thinkwiki, the updates are slow in coming.

Follow Up

Please refer to:

https://wiki.archlinux.org/index.php/Tp_smapi and also read about TLP. You can find the tlp package on the openSUSE website. Another option is to use “systemd” to control the battery.

http://linrunner.de/en/tlp/tlp.htmlhttp://software.opensuse.org/package/tlp

Battery Thresholds

kondor’s IT beetlebum: Make new ThinkPad’s charge thresholds work in Debian/Ubuntu

acpi_call can easily be installed, provided you have installed the kernel development pattern do as follows in a folder of your choice.

git clone https://github.com/mkottman/acpi_call/

Now copy the following script into a file in the acpi_call folder

KERNEL_TYPE=`uname -r | cut -f3 -d"-"`

INSTALLED=`zypper --no-refresh info kernel-$KERNEL_TYPE-devel | grep Installed: | cut -f2 -d' '`
if  "$INSTALLED" != "Yes" ] ; then
  echo "Do you want me to install the kernel-devel and kernel-$KERNEL_TYPE-devel packages"
  echo "needed for the acpi_call build (y/n) ?"
  read answer
  case "$answer" in
  y|Y)
    if  "$INSTALLED" != "Yes" ] ; then
      zypper install kernel-$KERNEL_TYPE-devel
      if  $? -ne 0 ]; then
    echo
    echo "Package manager failed to install needed packages..."
    echo
    exit 21
      fi
    fi
    zypper update
  ;;
  n|N)
    echo "Packages will NOT be installed."
  ;;
  *)
  ;;
  esac
fi


INSTALLED=`zypper --no-refresh info gcc | grep Installed: | cut -f2 -d' '`
if  "$INSTALLED" != "Yes" ] ; then
  echo "Do you want me to install the git, make and gcc packages"
  echo "needed for the acpi_call build (y/n) ?"
  read answer
  case "$answer" in
  y|Y)
    if  "$INSTALLED" != "Yes" ] ; then
      zypper install git-core make gcc
      if  $? -ne 0 ]; then
    echo
    echo "Package manager failed to install needed packages..."
    echo
    exit 21
      fi
    fi
    zypper update
  ;;
  n|N)
    echo "Packages will NOT be installed."
  ;;
  *)
  ;;
  esac
fi


INSTALLED=`zypper --no-refresh info dkms | grep Installed: | cut -f2 -d' '`
if  "$INSTALLED" != "Yes" ] ; then
  echo "Do you want me to install the dkms package needed for the acpi_call build (y/n) ?"
  read answer
  case "$answer" in
  y|Y)
    VERSION=`cat /etc/SuSE-release | grep VERSION | cut -f3 -d" "`
    zypper --plus-repo http://packman.inode.at/suse/openSUSE_$VERSION/Extra install dkms
    if  $? -ne 0 ]; then
      echo
      echo "Package manager failed to install needed package..."
      echo
      exit 21
    fi
    zypper update
  ;;
  n|N)
    echo "Package will NOT be installed."
  ;;
  *)
  ;;
  esac
fi


ACPICALLVERSION=1.0


if  `dkms status |grep acpi_call | wc -l` -gt 0 ]; then
 echo 
 echo "acpi_call module already installed, do you want to update/reinstall? (y/n)"
 echo
 read answer


 case "$answer" in
  y | Y )
   dkms uninstall -m acpi_call -v `dkms status |grep acpi_call |cut -f2 -d, |cut -f1 -d:`   
   dkms remove -m acpi_call -v `dkms status |grep acpi_call |cut -f2 -d, |cut -f1 -d:` --all
   rm -rf /usr/src/acpi_call*
   cd /tmp
   git clone http://github.com/mkottman/acpi_call.git
   mv acpi_call /usr/src/acpi_call-$ACPICALLVERSION


   echo 'PACKAGE_NAME="acpi_call"
   PACKAGE_VERSION="'$ACPICALLVERSION'"
   CLEAN="make clean"
   BUILT_MODULE_NAME[0]="acpi_call"
   DEST_MODULE_NAME[0]="acpi_call"
   MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir
   PWD=$dkms_tree/acpi_call/1.0/build" 
   DEST_MODULE_LOCATION[0]="/updates/dkms/"
   AUTOINSTALL="yes"' > /usr/src/acpi_call-$ACPICALLVERSION/dkms.conf


   dkms add -m acpi_call -v $ACPICALLVERSION
   dkms build -m acpi_call -v $ACPICALLVERSION
   dkms install -m acpi_call -v $ACPICALLVERSION


   cd "$BUMBLEBEEPWD"
  ;;


  *)
  
  ;;
 esac 
else


 rm -rf /usr/src/acpi_call*
 cd /tmp
 git clone http://github.com/mkottman/acpi_call.git
 mv acpi_call /usr/src/acpi_call-$ACPICALLVERSION


 echo 'PACKAGE_NAME="acpi_call"
 PACKAGE_VERSION="'$ACPICALLVERSION'"
 CLEAN="make clean"
 BUILT_MODULE_NAME[0]="acpi_call"
 DEST_MODULE_NAME[0]="acpi_call"
 MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir
 PWD=$dkms_tree/acpi_call/1.0/build"
 DEST_MODULE_LOCATION[0]="/updates/dkms/"
 AUTOINSTALL="yes"' > /usr/src/acpi_call-$ACPICALLVERSION/dkms.conf


 dkms add -m acpi_call -v $ACPICALLVERSION
 dkms build -m acpi_call -v $ACPICALLVERSION
 dkms install -m acpi_call -v $ACPICALLVERSION


 cd "$BUMBLEBEEPWD"
fi

Make the script executable su to root and execute it, that’s all!