]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/pci/quirks.c
PCI: Suspend/resume quirks for Apple thunderbolt
authorAndreas Noever <andreas.noever@gmail.com>
Tue, 3 Jun 2014 20:04:10 +0000 (22:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2014 21:12:26 +0000 (14:12 -0700)
commit1df5172c5c251ec24a1bd0f44fe38c841f384330
tree6ef651bcd83df4201b74178a617f6da5a57fe7d3
parent7d2a01b87f1682fde87461864e6682031bfaa0a9
PCI: Suspend/resume quirks for Apple thunderbolt

Add two quirks to support thunderbolt suspend/resume on Apple systems.
We need to perform two different actions during suspend and resume:

The whole controller has to be powered down before suspend. If this is
not done then the native host interface device will be gone after resume
if a thunderbolt device was plugged in before suspending. The controller
represents itself as multiple PCI devices/bridges. To power it down we
hook into the upstream bridge of the controller and call the magic ACPI
methods.  Power will be restored automatically during resume (by the
firmware presumably).

During resume we have to wait for the native host interface to
reestablish all pci tunnels. Since there is no parent-child relationship
between the NHI and the bridges we have to explicitly wait for them
using device_pm_wait_for_dev. We do this in the resume_noirq phase of
the downstream bridges of the controller (which lead into the
thunderbolt tunnels).

Signed-off-by: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/quirks.c