diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-01-07 07:10:35 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-01-07 14:18:04 -0500 |
commit | 98e6e286d7b01deb7453b717aa38ebb69d6cefc0 (patch) | |
tree | 3dbaf0cdc71a779f6f1d3bed8f9fd17eeabb97cd /drivers | |
parent | ad8cfa1defee14a5181d9b63e666318c51cfaeed (diff) |
PCI PM: Register power state of devices during initialization
Use the observation that the power state of a PCI device can be
loaded into its pci_dev structure as soon as pci_pm_init() is run for
it and make that happen.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e491fdedf705..c12f6c790698 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1260,14 +1260,15 @@ void pci_pm_init(struct pci_dev *dev) | |||
1260 | /* find PCI PM capability in list */ | 1260 | /* find PCI PM capability in list */ |
1261 | pm = pci_find_capability(dev, PCI_CAP_ID_PM); | 1261 | pm = pci_find_capability(dev, PCI_CAP_ID_PM); |
1262 | if (!pm) | 1262 | if (!pm) |
1263 | return; | 1263 | goto Exit; |
1264 | |||
1264 | /* Check device's ability to generate PME# */ | 1265 | /* Check device's ability to generate PME# */ |
1265 | pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc); | 1266 | pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc); |
1266 | 1267 | ||
1267 | if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { | 1268 | if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { |
1268 | dev_err(&dev->dev, "unsupported PM cap regs version (%u)\n", | 1269 | dev_err(&dev->dev, "unsupported PM cap regs version (%u)\n", |
1269 | pmc & PCI_PM_CAP_VER_MASK); | 1270 | pmc & PCI_PM_CAP_VER_MASK); |
1270 | return; | 1271 | goto Exit; |
1271 | } | 1272 | } |
1272 | 1273 | ||
1273 | dev->pm_cap = pm; | 1274 | dev->pm_cap = pm; |
@@ -1306,6 +1307,9 @@ void pci_pm_init(struct pci_dev *dev) | |||
1306 | } else { | 1307 | } else { |
1307 | dev->pme_support = 0; | 1308 | dev->pme_support = 0; |
1308 | } | 1309 | } |
1310 | |||
1311 | Exit: | ||
1312 | pci_update_current_state(dev, PCI_D0); | ||
1309 | } | 1313 | } |
1310 | 1314 | ||
1311 | /** | 1315 | /** |