diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6edecff0b419..3835871f4832 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -513,7 +513,11 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
513 | else if (state == PCI_D2 || dev->current_state == PCI_D2) | 513 | else if (state == PCI_D2 || dev->current_state == PCI_D2) |
514 | udelay(PCI_PM_D2_DELAY); | 514 | udelay(PCI_PM_D2_DELAY); |
515 | 515 | ||
516 | dev->current_state = state; | 516 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); |
517 | dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK); | ||
518 | if (dev->current_state != state && printk_ratelimit()) | ||
519 | dev_info(&dev->dev, "Refused to change power state, " | ||
520 | "currently in D%d\n", dev->current_state); | ||
517 | 521 | ||
518 | /* According to section 5.4.1 of the "PCI BUS POWER MANAGEMENT | 522 | /* According to section 5.4.1 of the "PCI BUS POWER MANAGEMENT |
519 | * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning | 523 | * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning |
@@ -2542,10 +2546,10 @@ int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type) | |||
2542 | 2546 | ||
2543 | /** | 2547 | /** |
2544 | * pci_set_vga_state - set VGA decode state on device and parents if requested | 2548 | * pci_set_vga_state - set VGA decode state on device and parents if requested |
2545 | * @dev the PCI device | 2549 | * @dev: the PCI device |
2546 | * @decode - true = enable decoding, false = disable decoding | 2550 | * @decode: true = enable decoding, false = disable decoding |
2547 | * @command_bits PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY | 2551 | * @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY |
2548 | * @change_bridge - traverse ancestors and change bridges | 2552 | * @change_bridge: traverse ancestors and change bridges |
2549 | */ | 2553 | */ |
2550 | int pci_set_vga_state(struct pci_dev *dev, bool decode, | 2554 | int pci_set_vga_state(struct pci_dev *dev, bool decode, |
2551 | unsigned int command_bits, bool change_bridge) | 2555 | unsigned int command_bits, bool change_bridge) |