Lenovo Thinkpad L540

This article contains information to assist when installing Gentoo on a Lenovo Thinkpad L540.

Unable to shutdown/reboot, irq N:nobody cared (try booting with the "irqpoll" option), system turns dead after resume from hibernation.
It seems that with kernel <4.0 you may have issues halting the system, which will result in hang after message about powering off. With kernel =4.0 you may have no longer such issue but after you resume from hibernation, USB ports may not work at all as well as you may start seeing the message about irq that nobody cared. With kernel =4.1 systems after resume from hibernation turns dead. The apps are semi-responsible but no new process can be spawned, like storage was offline. Booting with `irqpoll` does make the system works as it should.

As of kernel 4.2.0-rc1 the issues with IRQ are no more.

Brightness control does not work
Depends on kernel version, you may need to boot with either acpi_osi=Linux or with empty string acpi_osi=

After resuming from hibernation system either ends up with black screen or crash shortly after resuming
Randomly, but often, after resuming from on-disk hibernation the system may hang with black screen or resume, but crash shortly after (multiple segfaults, later resulting in whole system freeze after several seconds)

Multiple sources reports that there's a bug in a whole range of Lenovo laptops, including but not limiting to X1 Carbon, E540, L540 and others, the bug affect USB 3.0 port and after disabling USB 3.0 in bios (system uses all ports as usb 2.0 after than) there's no longer issue with resume. In case of this very L540 that wasn't enough. Solution was to disable XHCI (usb 3.0) driver in kernel as well as disabling PREEMPT in the kernel and reducing timer frequency to 100 Hz, by changing the symbols:

This is hardly considered as fix, but rather a workaround that does not trigger the bug.

Wrong order of ALSA cards (First HDMI, then PCH
For some reason the card0 is not the PCH card. This can be changed with index option of snd-hda-intel module.

One can create /etc/modprobe.d/alsa-reorder.conf with

options snd_hda_intel index=1,0

To reorder the PCH as first card.

Random system hangs with possible screen artifacts
Since update to BIOS version J4ET76WW (1.76) random hard-freezes have been experienced. The screen usually is torn apart. Update to BIOS version 1.78 solve the issue. All version from 1.74 to 1.76 are no longer available on the Lenovo page. 1.77 was never public and 1.78 changelog lists only changes from 1.77 to 1.78.