aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/portdrv_pci.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2018-09-27 16:41:48 -0500
committerBjorn Helgaas <bhelgaas@google.com>2018-10-02 16:04:40 -0500
commit94c7993fb5bd1e3c20f67a2d24ba05bbdc938340 (patch)
tree0d8844b4cf57b4d7caff8ca5ab48869bb85ddf76 /drivers/pci/pcie/portdrv_pci.c
parentPCI/portdrv: Resume upon exit from system suspend if left runtime suspended (diff)
downloadlinux-dev-94c7993fb5bd1e3c20f67a2d24ba05bbdc938340.tar.xz
linux-dev-94c7993fb5bd1e3c20f67a2d24ba05bbdc938340.zip
PCI/portdrv: Add runtime PM hooks for port service drivers
When PCIe port is runtime suspended/resumed some extra steps might be needed to be executed from the port service driver side. For instance we may need to disable PCIe hotplug interrupt to prevent it from triggering immediately when PCIe link to the downstream component goes down. To make the above possible add optional ->runtime_suspend() and ->runtime_resume() callbacks to struct pcie_port_service_driver and call them for each port service in runtime suspend/resume callbacks of portdrv. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> [bhelgaas: adjust "slot->state" for 5790a9c78e78 ("PCI: pciehp: Unify controller and slot structs")] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/pci/pcie/portdrv_pci.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index a1379151c565..0acca3596807 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -45,12 +45,10 @@ __setup("pcie_ports=", pcie_port_setup);
#ifdef CONFIG_PM
static int pcie_port_runtime_suspend(struct device *dev)
{
- return to_pci_dev(dev)->bridge_d3 ? 0 : -EBUSY;
-}
+ if (!to_pci_dev(dev)->bridge_d3)
+ return -EBUSY;
-static int pcie_port_runtime_resume(struct device *dev)
-{
- return 0;
+ return pcie_port_device_runtime_suspend(dev);
}
static int pcie_port_runtime_idle(struct device *dev)
@@ -73,7 +71,7 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = {
.restore_noirq = pcie_port_device_resume_noirq,
.restore = pcie_port_device_resume,
.runtime_suspend = pcie_port_runtime_suspend,
- .runtime_resume = pcie_port_runtime_resume,
+ .runtime_resume = pcie_port_device_runtime_resume,
.runtime_idle = pcie_port_runtime_idle,
};