1. You may have noticed things look a little different around here - we've switched to a new platform (XenForo) and have some new forum styles and features. This how-to guide will help you find your way around. If you find anything that looks strange, post it in this thread.

Linux on the X220

Discussion in 'Lenovo' started by ksvjdsvagff, May 3, 2011.

  1. OtherSongs

    OtherSongs Notebook Evangelist

    Messages:
    640
    Likes Received:
    1
    Trophy Points:
    31
    I can believe "12 hrs of battery without ANY tweaks on the x230 in Ubuntu 12.04 with the 9--cell"

    Battery life hugely depends on screen brightness setting.

    I've got a X220 w/6-cell and am very pleased. Battery life of ~7 hours with somewhat dim brightness/contrast setting w/Win7.
     
  2. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    OtherSongs: Are you running linux?
     
  3. OtherSongs

    OtherSongs Notebook Evangelist

    Messages:
    640
    Likes Received:
    1
    Trophy Points:
    31
    Not yet on either my slightly older X220, or my very new T530 laptops.

    But I expect to try a dual Win7/Linux boot with both laptops.

    1st priority has been and continues to be, getting set up with boot SSD on both laptops.

    X220 works great with boot mSATA SSD only, and no HDD (pulled it out on X220 thereby saving ~6oz (drive + metal sled + plastic rails)); and leaving HDD bay open for occasional clone of boot SSD to temp HDD backup).

    Next few days I'll do a 2 SSD setup on my T530, boot drive in the main bay and secondary SSD in the DVD bay.

    Still undecided as to which flavor(s) of Linux I'll try with a dual boot Win/Linux setup with one or both of my laptops. Odds are that I'll 1st try dual boot (Win7/Linux) with my T530.

    When Crucial's new M500 512GB mSATA drives come out in a few months, I'll move to that on my X220 and then play around with a dual Win7/Linux boot setup on my X220 as I'll then have enough drive space on it to do that.
     
  4. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    I located the problem with expresscard hotplugging (after 8 kernel builds!), and I'm working on a patch.
     
  5. 600X

    600X Notebook Deity

    Messages:
    747
    Likes Received:
    89
    Trophy Points:
    41
    12h on a 9c without any optimizations is NOT possible on 12.04. I tried it myself. However, 9h are possible if you install TLP. With my broken 6c, I get around 5h on Ubuntu with TLP installed.

    BTW, the M500 won't fit into the X220, the X220 has an mSATA Slot.
     
  6. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    Here's a quick and dirty patch for expresscard hotplugging... this is against 3.7.7:

    Code:
    diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
    index ebb3e5f..b427aad 100644
    --- a/drivers/pci/pcie/portdrv_pci.c
    +++ b/drivers/pci/pcie/portdrv_pci.c
    @@ -225,7 +225,7 @@ static int __devinit pcie_portdrv_probe(struct pci_dev *dev,
     	 * it by default.
     	 */
     	dev->d3cold_allowed = false;
    -	if (!pci_match_id(port_runtime_pm_black_list, dev))
    +	if (pci_match_id(port_runtime_pm_black_list, dev))
     		pm_runtime_put_noidle(&dev->dev);
     
     	return 0;
    
    Also here's my 3.7.7 config: config-3.7.7.txt
     
  7. OtherSongs

    OtherSongs Notebook Evangelist

    Messages:
    640
    Likes Received:
    1
    Trophy Points:
    31
    Crucial's new M500 512GB mSATA SSD drive is what I said. See my above quote.

    And with regard to the 2.5" Crucial M500 SSD drive, it's hard for me to believe that it won't have a 7mm thick option. Odds are that one can just ditch the HDD?
     
  8. 600X

    600X Notebook Deity

    Messages:
    747
    Likes Received:
    89
    Trophy Points:
    41
    OK sorry, must have misread.
     
  9. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    In the just released 3.8 kernel there's a bug in the e1000e driver that prevents the card from waking up after the ethernet cable is plugged in for the first time after being unplugged:
    Linux-Kernel Archive: [REGRESSION 3.8-r1] broken pci irq/pm state for e1000e device
    SourceForge.net: Intel Ethernet Drivers and Utilities:

    It comes back after a suspend/resume. If you want to run 3.8, plan on using my expresscard hotplugging patch (posted earlier) and fixing this ethernet problem by reverting commit 42eca2302146fed51335b95128e949ee6f54478f

    Here's my 3.8 config: http://www.mediafire.com/file/n53m73fdhumn3t8/config-3.8.0.txt
     
  10. vlitzer

    vlitzer Newbie

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    5
    Thanks man.
    Can I use that config for instance while following this instructions?
    Lindqvist -- a blog about Linux and Science. Mostly.: 342. Compiling Kernel 3.8 on Debian Testing/Wheezy
    Im planning to do it on a crunchbang installation.

    thanks in advance

    EDIT: or maybe its better to use a 3.7 for avoiding the 3.8 bug?
     
  11. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    Yeah I would run 3.7 unless you are familiar with building and patching the kernel and really need 3.8 for some reason. If you want me to make a patch for the e1000e driver, let me know.
     
  12. mil2

    mil2 Notebook Consultant

    Messages:
    171
    Likes Received:
    9
    Trophy Points:
    31
    I've been seeing better power consumption lately, perhaps after a kernel upgrade to 3.8.4. My machine can now idle at 6.8W, according to PowerTop. That's with i7, 8 GB RAM, WiFi on, BT off, screen brightness 9, and an SSD. I did notice that the SSD must be idle to get that low; as with spinning drives, there is an almost 1W difference between an SSD in "active/idle" vs "standby" mode (hdparm -C). That's with Intel 320, BTW.
     
  13. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    Can you post a screenshot of powertop's device stats?

    --

    As my X220 is getting older and I want to keep it alive longer, I'm starting to use some more aggressive fan settings. The tradeoff is more power consumption and noise. Here's my updated thinkfan.conf:
    Code:
    sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input
    (0,     0,      55)
    (1,     55,     61)
    (2,     59,     65)
    (3,     63,     69)
    (4,     67,     75)
    (5,     73,     85)
    (7,     81,     89)
    ("level disengaged",     84,     32767)
    
    The last line makes the fan run at its maximum mechanical speed. See: How to control fan speed - ThinkWiki
     
  14. OtherSongs

    OtherSongs Notebook Evangelist

    Messages:
    640
    Likes Received:
    1
    Trophy Points:
    31
    Odds are that all your X220 needs is 1) re-paste the cpu and/or 2) blow dust out of the heat sink fins.

    BTW, what made you choose Debian over the many other free Linux distros?

    I had problems with current Debian on desktop PC, as Debian's default install failed to install dual boot (using GRUB2) with WinXP.

    Whereas Ubuntu 12.10 properly installed dual boot on that desktop.

    My near term goal with both my laptops (see sig) is to dual boot Win7 and Linux with 2 SSD on each machine; just waiting a few more weeks to order a 480GB Crucial M500 mSATA as my new X220 boot drive. :)

    Of course, I'll move the X220's current 256GB Crucial M4 mSATA drive to my T530 (as a secondary drive on the T530, with a 2.5" M4 as boot on the T530).
     
  15. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    I am trying to keep the laptop cooler so that its components last longer; this is proactive not reactive. ;)

    Debian has been my OS of choice for so many years now that I am pretty much dyed in the wool.
     
  16. mil2

    mil2 Notebook Consultant

    Messages:
    171
    Likes Received:
    9
    Trophy Points:
    31
    Here you go:

    powertop2.png powertop1.png

    I've never tweaked fan settings on x220. The BIOS defaults seem to work fine for me.
     
  17. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    Your fan isn't registering any power usage. What's up with that? Do you have the thinkpad_acpi module loaded? If I set my fan to level 1 as yours is in the screenshot:
    Code:
      1.68 W     1987 rpm     Laptop fan
    The thinkfan.conf I posted above is aiming to not see 90C for more than a second or two when I'm slamming the CPU. It's not because of any existing problem, per se.
     
  18. mil2

    mil2 Notebook Consultant

    Messages:
    171
    Likes Received:
    9
    Trophy Points:
    31
    Powertop lacks the ability to make the per-device numbers accurate, as it can only measure the overall power consumption of the system. So it observes the changes in power consumption and attempts to correlate them with the also observed changes in the status of individual devices. The problem is that it can only query a subset of devices (e.g., connecting an external display draws power, but I don't think it's reflected anywhere on the device list). Also, some devices are correlated, e.g., CPU and fan, but not in a straightforward way: there is a hysteresis there, the correlation depends on external factors such as air temperature and humidity, etc.

    Erm, sorry for the little lecture, I'm a scientist and I'm typing this while at work :). What I meant to say is that the per-device data can't be accurate and in fact tends to be extremely inaccurate from what I've noticed (e.g., I've seen claims that idle eth0 uses 3W or something ridiculous like that), so I suggest not to pay any attention to it. My fan does in fact spin and I'm sure that it consumes some power :).
     
  19. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251
    I'm trying to figure out where your extra ~1.5W went (you know, so that I can maybe lose it too)! :p

    The battery rate doesn't lie, I'm not doubting your overall power consumption. But I've been running 3.8 and now 3.9-rc with nowhere near 1W less draw.
     
  20. ALLurGroceries

    ALLurGroceries   Super Moderator

    Messages:
    6,814
    Likes Received:
    373
    Trophy Points:
    251

Share This Page