Commit e92605b0 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/pm'

- Leave Apple Thunderbolt controllers on for s2idle or standby so they work
  after resume (Konstantin Kharlamov)

* pci/pm:
  PCI: Leave Apple Thunderbolt controllers on for s2idle or standby
parents c9fb9042 4694ae37
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <linux/nvme.h>
#include <linux/platform_data/x86/apple.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
#include <linux/switchtec.h>
#include <asm/dma.h>	/* isa_dma_bridge_buggy */
#include "pci.h"
@@ -3634,6 +3635,16 @@ static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev)
		return;
	if (pci_pcie_type(dev) != PCI_EXP_TYPE_UPSTREAM)
		return;

	/*
	 * SXIO/SXFP/SXLF turns off power to the Thunderbolt controller.
	 * We don't know how to turn it back on again, but firmware does,
	 * so we can only use SXIO/SXFP/SXLF if we're suspending via
	 * firmware.
	 */
	if (!pm_suspend_via_firmware())
		return;

	bridge = ACPI_HANDLE(&dev->dev);
	if (!bridge)
		return;