Ask HN: Any tips on debugging Linux hibernate issues?

17 points by war1025 ↗ HN
I tried posting on r/linuxquestions but the only response I got was generally unhelpful. I thought I would try here since this seems like a more professional crowd.

I have two laptops: Thinkpad T540p, Dell Insprion.

I've had the thinkpad for ~2 years. Hibernate has never worked consistently on it. I can usually get it to resume once or twice, but after I try to do anything useful, it will freeze when waking up.

About a month ago I bought the Inspiron for my wife. It seems to have the same issue. I had always assumed that the Thinkpad had issues because it had a dedicated Nvidia graphics card. But the inspiron only has onboard Intel, so that seems to not be the issue.

I found [this article](https://01.org/blogs/rzhang/2015/best-practice-debug-linux-suspend/hibernate-issues) and set the `no_console_suspend` boot parameter on both laptops.

Both go through the resume process and everything seems to go fine until they get stuck at a call to `lapic_suspend`. It looks like to me that is the call that starts hibernate, and it is trying to come back out of it and resume execution. Except for whatever reason, both laptops get hung instead.

Has anyone experienced this issue? Any tips? Hibernate has always worked great for me up until these two laptops.

Both are running Debian Unstable. This is the current `uname -a`: `Linux Babel 4.7.0-1-amd64 #1 SMP Debian 4.7.8-1 (2016-10-19) x86_64 GNU/Linux`

I am a software developer by trade and wouldn't mind digging through source code if it came to that, but I'm just not even sure where to start.

15 comments

[ 3.7 ms ] story [ 19.6 ms ] thread
Start with a pendrive / USB boot and try different distro. Try both older and newer debian-based distros like mint or ubuntu which usually have better laptop support than vanilla debian to see if you can narrow down the problem.
Might be a GPU driver issue. Are using the Nvidia binary?
Only one of the laptops has an Nvidia card, and I've used `bbswitch` to disable it.
Perhaps use smartctl to run a long test on the drive you're hibernating to.
I have the same problem with a Thinkpad x240. Never managed to figure it out, instead I just use suspend which works reliably.
I normally just use suspend too.

I would definitely suggest trying the 4.8 kernel as mentioned in another comment. So far I haven't been able to make it fail.

By any chance, do you know which kernel commit(s) fixed your issue? Maybe git bisect can pinpoint the commit? It would be interesting to know what the exact bug was.
This is a shot in the dark but some nasty hibernation bugs are fixed in 4.8[1]. It's probably worth booting a kernel from that series to see if it helps.

[1] https://lwn.net/Articles/701639/

Thanks for the tip. Install 4.8 now to try it out.
So far it looks like this may have been the issue. I've done some stress testing of things that always made it fail to resume in the past, and it has successfully woken up each time.

Thanks for the tip!

Great! Thanks for taking the time to reply. Unresolved questions always bug me.
(comment deleted)
An update a week later: The 4.8 kernel appears to have fixed the issue. I have not had a single issue all week.