Friday, June 28, 2019

Fix Lenovo T460 failure to suspend (sleep) under Linux

My Lenovo T460 with Intel integrated graphics abruptly stopped suspending properly a few weeks ago and it's been driving me nuts. Today I fixed it.

TL;DR: For my specific issue lowering the integrated graphics memory portal from 512MB to 256MB in the UEFI firmware setup ("BIOS setup", F1 boot menu) resolved the issue.



Symptoms


Symptoms of the failure were:

  • Appears to suspend normally, screen blanks, etc
  • Will not wake up in response to lid open, keyboard, or power button press
  • Power LED blinks faster than usual for sleep mode
  • Fn key light remains on
  • Must press and hold power button for 10 seconds to get it to fully turn off

I move around a fair bit when I'm working sometimes, so this was driving me nuts.

I tried updating to Fedora 30, the latest Fedora Rawhide kernel, the latest vanilla kernel for Fedora. No dice.

I tried blacklisting every module that wasn't essential to boot in /etc/modprobe.d/ . No luck.

I tried disabling every I/O port and device in the UEFI firmware setup. No improvement.

I tried a variety of kernel command line options that might be relevant, still without success. (Hint: edit /etc/default/grub then sudo grub2-mkconfig -o /etc/grub2.cfg or if you use UEFI boot like me, /etc/grub2-efi.cfg).

I updated the UEFI firmware, which was a major hassle from Linux, especially since I couldn't find my external USB DVD drive.

I did a bunch of suspend/resume debugging using /sys/power/pm_trace and /sys/power/pm_debug_messages which pointed me at "mem48", but I couldn't find any driver by that name in the kernel sources or any hint about what might be going on. IIRC the error was:

hash matches device mem48

and I found a few bugzilla entries, forum posts etc that appeared relevant but shed no light. (Will add links when I find them again).

Nothing I tried helped.

I gave up and swore at my laptop a lot.

It had suddenly stopped suspending properly after I updated to the latest Fedora 29 kernel in preparation for my Fedora 30 upgrade. So I became somewhat fixated on kernel or driver related issues. You can probably tell.

Fix


Then this morning I remembered that I'd had to reset the UEFI firmware settings due to an unrelated issue a few days prior to my F29 kernel upgrade, and I hadn't used it much since. Gee, I wonder... when I put the settings back "how they were" did I get something wrong?

So I did another reset to defaults, then checked.

And sure enough the default graphics memory is 256MB. I thought I remembered raising it to 512MB because the Intel graphics driver complaining about not having enough memory to perform optimally - I run a high res dual head setup. But I guess I must not have, because that was the problem.

Lowering graphics memory to 256MB fixed the issue.

I guess that suggests an issue in the i915 driver. I'm not sure. But it's working, finally, after many wasted hours, and all I had to do was reset the UEFI defaults then not mess with them...

Update: Not so fast, now I can't break it again


So I put the settings back to try to repro the issue... and it doesn't fail anymore.

So the issue may not have been the graphics memory at all.

I think I turned off the Intel Management Engine in UEFI when I locked down everything I could turn off today, so later I'll try re-enabling it and see if that breaks suspend again. Knowing my luck it'll work now. But anyway, hopefully I point some future person in a useful direction with this post.

No comments:

Post a Comment

Captchas suck. Bots suck more. Sorry.