aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6f45a73c6e9f..6d4a5319148d 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)
664 error = platform_pci_set_power_state(dev, state); 664 error = platform_pci_set_power_state(dev, state);
665 if (!error) 665 if (!error)
666 pci_update_current_state(dev, state); 666 pci_update_current_state(dev, state);
667 /* Fall back to PCI_D0 if native PM is not supported */
668 if (!dev->pm_cap)
669 dev->current_state = PCI_D0;
667 } else { 670 } else {
668 error = -ENODEV; 671 error = -ENODEV;
669 /* Fall back to PCI_D0 if native PM is not supported */ 672 /* Fall back to PCI_D0 if native PM is not supported */
@@ -1126,7 +1129,11 @@ static int __pci_enable_device_flags(struct pci_dev *dev,
1126 if (atomic_add_return(1, &dev->enable_cnt) > 1) 1129 if (atomic_add_return(1, &dev->enable_cnt) > 1)
1127 return 0; /* already enabled */ 1130 return 0; /* already enabled */
1128 1131
1129 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) 1132 /* only skip sriov related */
1133 for (i = 0; i <= PCI_ROM_RESOURCE; i++)
1134 if (dev->resource[i].flags & flags)
1135 bars |= (1 << i);
1136 for (i = PCI_BRIDGE_RESOURCES; i < DEVICE_COUNT_RESOURCE; i++)
1130 if (dev->resource[i].flags & flags) 1137 if (dev->resource[i].flags & flags)
1131 bars |= (1 << i); 1138 bars |= (1 << i);
1132 1139