Ubuntu – System freezes completely with Intel Bay Trail

16.04intelkernel

My system freezes completely at random, frequent intervals. I started to have the same problem in Ubuntu 14.04 but after recent upgrade to 16.04 there is no improvement, in fact it seems worse.

When it happens, it's impossible to do anything. I've tried everything in this thread: What to do when Ubuntu freezes but nothing works, I have to hard reset. I have read all the system logs and journalctl but there is never any information that could help diagnose the problem.

This is a dual-boot system with Windows 10 and there's no problem there, so it's not defective hardware.

My laptop has an Intel Bay Trail processor (Pentium N3540)

Best Answer

Your processor is affected by the c-state bug

This causes total freezes when the CPU tries to enter an unsupported sleep state. It's a problem for many Bay Trail devices especially with newer (4.*) kernels.

Affected processors AFAIK:

Atom Z3735F (Asus X205TA, Acer Aspire Switch 10, Lenovo MIIX 3 1030) 
Atom Z3735G
Celeron J1900 (Asus ET2325IUK, shuttle XS35V4)
Celeron N2940 (Acer Aspire ES1-711, Chromebook)
Celeron N2840 (Acer Aspire ES1-311)
Celeron N2930 (Jetway JBC311U93, Zotac Nano CI320)
Pentium N3520 
Pentium N3530 (Acer V3-111P)
Pentium N3540 (Dell Inspiron 15 3000, Lenovo G50, ASUS X550MJ)

(please (suggest an) edit to add your own device if affected)

Complete list of Bay Trail processors may be found here

There is a simple workaround for this until it gets properly fixed upstream.

You just need to pass a kernel boot parameter and the random freezing stops completely. The parameter may increase battery consumption slightly, but it will give you a usable system.

You do this by editing the configuration file for GRUB:

Boot Ubuntu and open a terminal by pressing Ctrl+Alt+T then type

sudo nano /etc/default/grub

Find the line that starts GRUB_CMDLINE_LINUX_DEFAULT=

This needs to be changed to include intel_idle.max_cstate=1

So after your edit it reads something like

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"

quiet and splash are default parameters for Ubuntu Desktop - no need to change them, or any other pre-existing parameters

Now save the file by pressing ctrl+o then enter and exit by pressing ctrl+x

Now run

sudo update-grub

Then reboot.


What to do if you don't have enough time to do this before the system hangs

No problem. As explained on the help page I linked to earlier, you can add the parameter to GRUB before booting. Note that this only passes the parameter for the current boot, so you still have to edit /etc/default/grub once you have booted to make the change permanent.

You need to get to the GRUB menu. If you are dual booting this will appear anyway, if not you have to press and hold (or tap) shift after pressing the power button to turn on.

When you get to this screen select Advanced Options for Ubuntu. You can move the cursor to a different kernel, or leave it in place to edit options for the default. Instead of pressing enter, press e and you will go into edit mode, looking vaguely like this.

Move the cursor down to where it says quiet splash, put a space after splash and carefully type intel_idle.max_cstate=1 making sure there is a space after it as well.

Now press F10 or Ctrl+x to boot.

Related Question