Standby and Shutdown Hang on Macbook Pro 11,4

It turns out this is now a documented problem with the MacbookPro 11,4 and 11,5 within the latest mainline linux kernel (I think up until 4.6 at the time of writing this). There is a work-around that requires patching/compiling a custom kernel. It's located at Comment #172 of https://bugzilla.kernel.org/show_bug.cgi?id=103211. Specifically,

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ee72ebe..d3ec833 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2775,6 +2775,13 @@ static void quirk_hotplug_bridge(struct pci_dev *dev)

 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HINT, 0x0020, quirk_hotplug_bridge);

+static void quirk_hotplug_bridge_skip(struct pci_dev *dev)
+{
+       dev->is_hotplug_bridge = 0;
+}
+
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8c10, quirk_hotplug_bridge_skip);
+
 /*
  * This is a quirk for the Ricoh MMC controller found as a part of
  * some mulifunction chips.

From within the comments, it looks like a handful of people have confirmed that this indeed works in Ubuntu 14.04 and 16.04 with different 4.X variations of the Linux kernel. I'm testing this now on 16.04, and will accept this answer if everything works OK. If anyone else is willing to confirm this patch on 14.04 with an earlier kernel release (3.X), please comment below.

UPDATE: I can confirm that this works in Ubuntu 16.04 with Kernel v4.4.0-28-generic. I did the following steps:

  • Obtain the correct kernel from the Ubuntu kernel git repo (https://wiki.ubuntu.com/Kernel/Dev/KernelGitGuide)
  • Implement the above patch by manually adding the quirk_hotplug_bridge(...) method and the DECLARE_PCI_FIXUP_HEADER(...) call
  • Compile the Kernel and dpkg install it (https://help.ubuntu.com/community/Kernel/Compile)

Everything seems to be working as it should.