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
This commit is contained in:
Bjorn Helgaas 2021-07-06 10:56:24 -05:00
commit e92605b0a0
1 changed files with 11 additions and 0 deletions

View File

@ -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;