Commit 718a0609 authored by Lukas Wunner's avatar Lukas Wunner Committed by Bjorn Helgaas

PCI: Unfold conditions to block runtime PM on PCIe ports

The conditions to block D3 on parent ports are currently condensed into a
single expression in pci_dev_check_d3cold().  Upcoming commits will add
further conditions for hotplug ports, making this expression fairly large
and impenetrable.  Unfold the conditions to maintain readability when they
are amended.

No functional change intended.
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
CC: Mika Westerberg <mika.westerberg@linux.intel.com>
CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 97a90aee
...@@ -2274,19 +2274,20 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) ...@@ -2274,19 +2274,20 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge)
static int pci_dev_check_d3cold(struct pci_dev *dev, void *data) static int pci_dev_check_d3cold(struct pci_dev *dev, void *data)
{ {
bool *d3cold_ok = data; bool *d3cold_ok = data;
bool no_d3cold;
/* if (/* The device needs to be allowed to go D3cold ... */
* The device needs to be allowed to go D3cold and if it is wake dev->no_d3cold || !dev->d3cold_allowed ||
* capable to do so from D3cold.
*/ /* ... and if it is wakeup capable to do so from D3cold. */
no_d3cold = dev->no_d3cold || !dev->d3cold_allowed || (device_may_wakeup(&dev->dev) &&
(device_may_wakeup(&dev->dev) && !pci_pme_capable(dev, PCI_D3cold)) || !pci_pme_capable(dev, PCI_D3cold)) ||
!pci_power_manageable(dev);
/* If it is a bridge it must be allowed to go to D3. */
!pci_power_manageable(dev))
*d3cold_ok = !no_d3cold; *d3cold_ok = false;
return no_d3cold; return !*d3cold_ok;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment