Support in other languages: 
Showing results for 
Search instead for 
Do you mean 
Reply
Fanfold Paper
wujj123456
Posts: 16
Registered: ‎02-17-2012
Location: United States

My T420 and Mint 12 Experience

Having switched from Ubuntu to Mint since Christmas, I am pretty happy with the GNOME classic interface.  I usually use a desktop, but I just bought a Thinkpad T420 for occasional usage.  I spent last two days tinkering around various issues and it's time to share some of my experience, as I got quite a lot of help from others’ discussions.  

I have no intention to make it complete (but should be correct).  It's just another thread for Googlers to refer to.  Please post if you have better ideas or corrections.

For all instructions, DO NOT JUST COPY EVERYTHING.  MAKE SURE YOU AT LEAST CHECK EACH COMMAND'S OUTPUT.  THE FILE PATH CAN BE VERY DIFFERENT FOR DIFFERENT CONFIGURATION OR MODEL.  It's better if you understand them though.  (I don’t claim that I fully understand them, but nevertheless, it worked for me. )  

$ indicates a command.  I skip sudo for convenience.  Whenever you have a permission error, try sudo first.  Also ignore #BEGIN and #END when editing files.

A.  My T420 Hardware
i5 2430M 2.4GHz
6GB DDR1333
HD3000 <- I decided to get rid of NV graphics due to the lack of support of Optimus, and Intel driver is always quite friendly to Linux
14.0 HD+ (1600x900) <- Definitely worth upgrading.  Otherwise I would go E420, which is much cheaper
320GB HDD
9-cell battery
Intel centrino wireless-N <- same before, betting on better Linux driver support

B.  BIOS/UEFI
Virtualization is disabled by default.  Make sure you turn it on if you will be using VM.  You also need to turn on "USB power when off" if you want to directly charge your phone when your laptop is off.  
Access BIOS by pressing F1.  Or the blue "Enter" button for other menus.  

C.  lm-sensors
There are lots of discussion on this topic.  Here is a quick version.
$ apt-get install lm-sensors
$ sensors-detect
Use default suggestions until when asking if you want to write to /etc/modules, select YES.
At this point, you can either manually load the list modules ($ modprobe xxxx) or just reboot.
Then you can use "$ sensors" to check
You should be able to see core temperature and fan speed.

D.  Hardware monitor applet
That's the applet which can display temperature, fanspeed on menu bar.  My instruction is only for GNOME classic, but I guess it will work for MATE too.  To add applet to your menu bar, ALT + right click on the menu bar.  
It's no longer in the package system.  Go to http://sensors-applet.sourceforge.net/index.php?content=source
Download the source code, untar it
$ ./configure --prefix=/usr
$ make
$ make install
You need to install several dev packages along the process.  Once it's done, you should see "Hardware Sensors Monitor" from "Add to Panel".  Add it and configure the sensors you want in preference.  

E.  HDD Temp
If your lm-sensors didn't detect HDD temperature, you can install hddtemp.
$ apt-get install hddtemp
Default config is fine.  Then use
$ hddtemp /dev/sd?
to check HDD temperature.  Or just add it in your applet display.  Your first HDD is /dev/sda, second is /dev/sdb, etc.

F.  Control the fan
By default, my fan is stuck at 3300RPM, no matter what.  This seems to be a common Thinkpad problem.  Here is the thread I used to fix that: http://ubuntuforums.org/showthread.php?t=1749186
Make sure the order is correct and you understand your /etc/thinkfan.conf.  Otherwise you could mistakenly stop your fan when CPU is at 80C.  

1. $ apt-get install thinkfan
2. make sure coretemp is in /etc/modules (should be done by sensors-detect already)
3. load kernel module coretemp (should be done by sensors-detect already)
4. add sensors to /etc/thinkfan.conf
Here is what my thinkfan.conf looks like.  Pretty easy to understand with comments in that file.  YOU NEED TO FIGURE OUT THE sensor LINE ON YOUR OWN!  IT COULD BE DIFFERENT FOR A DIFFERENT CONFIG/MODEL.  Use "$ cat xxxx" to check if its output (in milli-Celsius) matches "$ sensors".  
#BEGIN
sensor /sys/devices/platform/coretemp.0/temp1_input
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input

(0, 0,  55)
(1, 48, 60)
(2, 50, 62)
(3, 52, 64)
(4, 56, 66)
(5, 59, 70)
(6, 63, 75)
(7, 66, 32767)
#END
5. add following line to /etc/modprobe.d/thinkfan.conf
options thinkpad_acpi fan_control=1
6. reload kernel module "thinkpad_acpi"
$ modprobe -r thinkpad_acpi && modprobe thinkpad_acpi
7. set START="yes" in /etc/default/thinkfan
8. start thinkfan:
$ /etc/init.d/thinkfan start
9. check whether it works:
$ cat /proc/acpi/ibm/fan

Fanfold Paper
wujj123456
Posts: 16
Registered: ‎02-17-2012
Location: United States
0

Re: My T420 and Mint 12 Experience


G.  Power usage regression
There were a huge buzz about Linux kernel power regression since 2.6.39, from Phoronix.  Not sure if it’s true (out of my knowledge), but adding this won’t hurt.  
http://www.techytalk.info/linux-kernel-2-6-38-2-6-39-power-regression-workaround/

H.  Extend battery life
It’s better to keep LION battery within 30-85% of charge.  Under Windows, you can do it with the Thinkpad software.  The tp-smapi tool does the same thing under Linux.  
http://www.thinkwiki.org/wiki/Tp_smapi#Battery_charge_control_features
Thinkwiki has great information, but some of them might be outdated.  I generally followed their guideline, except for some changes.  Didn’t find a good place to put them back to the wiki though.  

1. $ apt-get install tp-smapi-dkms
Now you should be able to set charging threshold:
$ sh -c 'echo 85 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh'
This makes charging stop at 85%.  For me, the start_charge_thresh didn’t work, but that’s not critical.  There are other interesting things you can do, and please refer to the previous thinkwiki link.  
2. Now let’s make the changes persistent
Load tp-smapi on reboot:
$ echo tp-smapi >> /etc/modules
Then set the threshold automatically using sysfs:
$ apt-get install sysfsutils
Add the following line to /etc/sysfs.conf
#BEGIN
devices/platform/smapi/BAT0/stop_charge_thresh = 85
EOF
#END

I.  Automatically adjust screen brightness on startup
Each time I boot up, the screen brightness is set to maxmium.  Hurts my eyes and hurts the battery.  
/sys/class/backlight/acpi_video0/brightness is the special file which controls the brightness.  For example, change brightness to level 6 (0-15):
$ echo 6 > /sys/class/backlight/acpi_video0/brightness
To make it automatic
1. Add a new script in /etc/init.d/adjustbrightness, and edit /etc/init.d/adjustbrightness (use whatever filename you want) to:
#!/bin/sh
echo 6 > /sys/class/backlight/acpi_video0/brightness
2. $ chmod 755 /etc/init.d/adjustbrightness
3. $ update-rc.d adjustbrightness defaults

J.  CPU frequency stuck at lowest level on AC only
Or when your Laptop is fully loaded, the recharging time becomes 10-20hrs or larger.  It’s not your OS’ problem.  (I wasted lots of time trying to “fix” this.)  Check if you have a 65W adapter.  You need to get a 90W one if you want to run full speed on AC only.  
http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/T420-slow-only-if-battery-not-plugged-in/td...

Paper Tape
Loranon
Posts: 6
Registered: ‎02-18-2012
Location: Germany
0

Re: My T420 and Mint 12 Experience

Hello wujj123456, Hello Forum

 

Thank you for the nice guide. I am using Linux Mint 12 on my T420s.

 

For completeness sake i just want to recommend the use of powertop / laptop-mode-tools to reduce power consumption.

Just install both pakets via apt-get.

By using this tools i reduced the consumption of my T420s to 8 W using wlan and usable brightness, 5 W with wlan off and brightness set to zero.

 

Although there is a little workaround necessary to have everything working:

 

Using Laptop-Mode-Tools

 

First you have to tell laptop-tools to work with your kernel ( only 3.x ).

Therefore ou have to edit the file /usr/sbin/laptop_mode near line 506

 

case "$KLEVEL" in
 "2.4" ) ;;
 "2.6" ) ;;
 "3.0" ) ;;
 *)
  log "ERR" "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2
  exit 1
  ;;

 After the editing it sould look like this. ( You have to add your kernel )

 

Using PowerTop

 

Powertop sets /sys/bus/pci/devices/*/power/control to "auto"

This can lead to strange behavior on shutting down the system when on battery : the system is going to power up as it shuts down.

 

This bug can be solved by setting all pci powercontrols to "on" via the following script that should be run on rc0.d and rc6.d

 

for con in /sys/bus/pci/devices/*/power/control; do
echo on > "$con"
done

 

Furthermore I would not recomment to use tp-smapi on T420 and T420s as it is not really supportet.

Only some of the functions work properly. For example it isn't possible to use force_discharge.

Although there is no harm if using it.

 

I think there might be some other problems you have to face, like keeping powertop suggestions persistent - but there are plenty of guides over the internet.

 

Hope i could give useful tips.

 

Sincerely,

Loranon

 

 

Fanfold Paper
wujj123456
Posts: 16
Registered: ‎02-17-2012
Location: United States
0

Re: My T420 and Mint 12 Experience

Thanks for the info.  I will try it some time this week.  I just dug out a note about undervolting the CPU, which I used to do on my laptop.  Probably worth trying too.  SNB has wide voltage margin, and any voltage reduction leads to dramatic power decrease. 

 

Does anyone know if PHC officially supports SNB now?

Fanfold Paper
wujj123456
Posts: 16
Registered: ‎02-17-2012
Location: United States
0

Re: My T420 and Mint 12 Experience

[ Edited ]

Hi Loranon,

 

I tried the laptop-mode-tool, and it significantly reduces the power usage.  However, it seems to interfere with my thinkfan configuration.  Do you observe similar effect?

 

In addition, if I manually start the laptop mode service, it crashes, saying buffer overflow detected. 

 

Btw, thank you for the powertop fix.  I actually always turn off my laptop with AC plugged in, and never realized the bug. :smileytongue: