Ubuntu – Laptop started crashing on resume, but only on battery

19.04power-managementsuspendxps

I have a Dell XPS 13 9350 model running ubuntu 19.04. As of the last few days, the system has become unable to resume from suspend – after a few seconds of the screen being blank, it appears to do a cold boot i.e. shows the Dell logo, starts Ubuntu and then displays the login screen.

This happens regardless of how the system is suspended (i.e. closing the lid, using the GUI power menu, systemctl suspend or sudo pm-suspend), but only happens if the system is on battery power when it is suspended or resumed, or if the power is unplugged while it's asleep. If it stays plugged in throughout, resuming works normally.

I've had this problem before some time ago, and it was magically fixed by a kernel update. So I initially suspected a regression, but have tried several older kernels (currently running 5.0.0-27, oldest I tried was 4.13.0) and all had the same problem. I also have the tlp power-saving package installed which I thought might be a potential culprit, but disabling that didn't help either. The laptop otherwise runs fine on battery power, so I don't think it's a hardware issue.

I've not been able to find anything helpful in the logs, /var/log/syslog shows a "system suspended successfully" message and then the normal cold-boot messages from after the crash. Using pm-suspend does produce an error report in /var/crash which I can post if it's likely to be informative, but again it just seems to be showing that the suspend happened successfully and then nothing after that.

I did experience a system lock-up requiring a hard shutdown (i.e. holding the power button) while the laptop was plugged into a Thunderbolt dock around the time I first noticed the issue, so wasn't sure whether that might've screwed something up. It seemed unlikely that this would persist through reboots, but if anyone can suggest a way to troubleshoot that or any other potential cause it'd be much appreciated, cheers.

edit 14/01/20: sorry I never gave an update, the resolution is somewhat unsatisfying though. The problem went away of its own accord after doing a complete cold-start, i.e. letting the battery run down completely before plugging back in and booting the system. I'm not entirely clear on why that would help, but I've not had the issue reoccur since.

edit 26/11/20: Suddenly the problem began occurring again, on the same system now running 20.10. I found this post suggesting that the embedded firmware controller is the culprit – some sort of transient error puts it in an invalid state which renders the system unable to recover from a suspend. Performing a cold start as I tried before resets the controller, restoring the normal behaviour. (note that running down the battery is not required, the system just needs to be powered off and then AC power-cycled)

This fixed the problem this time as well, so in case anyone still finds this post, this appears to be a reliable fix.

Best Answer

I have been having a similar problem mid-December with my Precision 7530. I could suspend my computer plugged in or running on battery, but I could not resume while running on battery.

I have tried stock Ubuntu 18.04.x, and Pop! OS 18.04 and 19.10. All were running variants of kernel 5.3.x, although Pop! OS builds their own kernel. BIOS upgraded to 0.1.12.1, the latest version at this time per Dell's website and firmware-manager. The computer is using my NVidia GPU, although the problem still happens with Intel graphics. No extra flags added my kernel parameters in /etc/default/grub.

I was clued into a solution by reinstalling my OS, and suspend/resume worked fine, until I installed updates. One of the updates is the intel-microcode package.

Rolling back intel-microcode from 3.20191115.1ubuntu018.04.2 to 3.20180312.0~ubuntu18.04.1, and apt-mark hold intel-microcode seems to have fixed the problem for now.

On a related note, my loaner Dell Precision 5520 with similar hardware specs running an up-to-date version of Pop! OS 18.04 does not have this problem.

Related Question