summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-17 19:40:51 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-17 19:40:51 +0100
commita36bfddd65b58dd8c8364dba919c04922e04f2f5 (patch)
tree6adfdaa4747377806d8e13256856de0699ba6cbe /drivers/pci/pci.c
parentLinux 3.2-rc6 (diff)
parentPCI: Set device power state to PCI_D0 for device without native PM support (diff)
downloadlinux-a36bfddd65b58dd8c8364dba919c04922e04f2f5.tar.xz
linux-a36bfddd65b58dd8c8364dba919c04922e04f2f5.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: PCI: Set device power state to PCI_D0 for device without native PM support PCI hotplug: Always allow acpiphp to handle non-PCIe bridges PCI: fix ats compile failure PCI: defer enablement of SRIOV BARS
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6f45a73c6e9f..faccb8937706 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -664,6 +664,9 @@ static int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state)
error = platform_pci_set_power_state(dev, state);
if (!error)
pci_update_current_state(dev, state);
+ /* Fall back to PCI_D0 if native PM is not supported */
+ if (!dev->pm_cap)
+ dev->current_state = PCI_D0;
} else {
error = -ENODEV;
/* Fall back to PCI_D0 if native PM is not supported */
@@ -1126,7 +1129,7 @@ static int __pci_enable_device_flags(struct pci_dev *dev,
if (atomic_add_return(1, &dev->enable_cnt) > 1)
return 0; /* already enabled */
- for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
+ for (i = 0; i < PCI_ROM_RESOURCE; i++)
if (dev->resource[i].flags & flags)
bars |= (1 << i);