Lenovo X220 reboots instead of shutting down

I'm here on Xubuntu 11.10 with an x220 i5 and experienced the same issue.

Installing laptop-mode-tools (with aptitude install laptop-mode-tools --without-recommends) fixed it for me.

(found the hint via https://answers.launchpad.net/ubuntu/+source/acpi/+question/168617)

I came up with another solution that does not involve laptop-mode-tools. Maybe it works for others. The problem seems to occur when power-management for PCI(e) devices is enabled (set to "auto"). Here are two ways to check that:

  1. run powertop, switch to the "Tunables" tab and see if your "Runtime PM for PCI*" entries are marked as "Good"
  2. cat /sys/bus/pci/devices/*/power/control and see if it outputs some "auto" values. "auto" causes the shutdown problems on my machine while "on" does not.

I created an init.d script to handle that (and other stuff like setting battery charge threshs and the like), available via pastebin.

Note:

  • The script runs fine on my machine. This does not mean it will run on others due to missing programs, etc.
  • The script does more than (potentially) circumventing the shutdown problem, so please read it first.
  • I am not sure that "auto" brings any benefit at all ;)

Hope it helps.