diff options
| author | Andi Kleen <andi@basil.nowhere.org> | 2006-11-21 04:22:09 -0500 |
|---|---|---|
| committer | Andi Kleen <andi@basil.nowhere.org> | 2006-11-21 04:22:09 -0500 |
| commit | 1b7f6a626f0ff511c3840678466cbfe1d62c0b29 (patch) | |
| tree | 415e8c838c0067bff384afb8a2c91e5f7c6d11d3 /drivers/pci/pci-driver.c | |
| parent | b3edc9cec07ade41aaf1804f7c9e876afa90c862 (diff) | |
| parent | 3f5a6ca31c334011fd929501a078424c0d3f71be (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/pci/pci-driver.c')
| -rw-r--r-- | drivers/pci/pci-driver.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index b1c0c707d96c..194f1d21d3d7 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
| @@ -265,6 +265,13 @@ static int pci_device_remove(struct device * dev) | |||
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | /* | 267 | /* |
| 268 | * If the device is still on, set the power state as "unknown", | ||
| 269 | * since it might change by the next time we load the driver. | ||
| 270 | */ | ||
| 271 | if (pci_dev->current_state == PCI_D0) | ||
| 272 | pci_dev->current_state = PCI_UNKNOWN; | ||
| 273 | |||
| 274 | /* | ||
| 268 | * We would love to complain here if pci_dev->is_enabled is set, that | 275 | * We would love to complain here if pci_dev->is_enabled is set, that |
| 269 | * the driver should have called pci_disable_device(), but the | 276 | * the driver should have called pci_disable_device(), but the |
| 270 | * unfortunate fact is there are too many odd BIOS and bridge setups | 277 | * unfortunate fact is there are too many odd BIOS and bridge setups |
| @@ -288,6 +295,12 @@ static int pci_device_suspend(struct device * dev, pm_message_t state) | |||
| 288 | suspend_report_result(drv->suspend, i); | 295 | suspend_report_result(drv->suspend, i); |
| 289 | } else { | 296 | } else { |
| 290 | pci_save_state(pci_dev); | 297 | pci_save_state(pci_dev); |
| 298 | /* | ||
| 299 | * mark its power state as "unknown", since we don't know if | ||
| 300 | * e.g. the BIOS will change its device state when we suspend. | ||
| 301 | */ | ||
| 302 | if (pci_dev->current_state == PCI_D0) | ||
| 303 | pci_dev->current_state = PCI_UNKNOWN; | ||
| 291 | } | 304 | } |
| 292 | return i; | 305 | return i; |
| 293 | } | 306 | } |
