summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2021-07-06 10:56:24 -0500
committerBjorn Helgaas <bhelgaas@google.com>2021-07-06 10:56:24 -0500
commite92605b0a0cdafb6c37b9d1ad24fe1cf8280eeb6 (patch)
tree36b24d508d7dda8e05062dc49a94e60d105210e0 /drivers/pci
parentc9fb9042c98df94197a1ba4cf14a77c8053b0fae (diff)
parent4694ae373dc2114f9a82f6ae15737e65af0c6dea (diff)
downloadlwn-e92605b0a0cdafb6c37b9d1ad24fe1cf8280eeb6.tar.gz
lwn-e92605b0a0cdafb6c37b9d1ad24fe1cf8280eeb6.zip
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
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/quirks.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index dcb229de1acb..0dde9c5259f2 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -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;