Linux randomly freezes on laptops with Baytrail processors and you are forced to do a hard restart, this an open issue of the kernel that apparently only affects the 4.x versions. You might feel hopeless as this is a low priority issue for the kernel but hopefully, there is a workaround.
PState is a technology present in Intel processors that allows the OS to regulate CPU frequency and voltage to adequate power consumption and performance, mostly to save battery life.
Change the pstate settings at kernel level. This should work with 4.x kernels, it has worked for me in Ubuntu 16.04 and Linux Mint 18.
sudo nano /etc/default/grub
Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add intel_idle.max_cstate=1, in my case I had: GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash" which I changed to GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash intel_idle.max_cstate=1"
Exit saving changes
For more details check this Linux kernel thread.
Fedora users can use this solution.
Hope it helps, happy hacking!