X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=drivers%2Fpci%2Fpci.c;h=6e1da5aa7bb9aec271e9793377c7096dd43ea031;hb=e13cdbd71fe12c4e191b737c4a3dbfdb4b2de03b;hp=6edecff0b41953a99b86c6edeb664325d7f14d90;hpb=b812cca4e2efe9a05de20ccf3f8587e7ac6e12fa;p=deliverable%2Flinux.git diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6edecff0b419..6e1da5aa7bb9 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) else if (state == PCI_D2 || dev->current_state == PCI_D2) udelay(PCI_PM_D2_DELAY); - dev->current_state = state; + pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); + dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK); + if (dev->current_state != state && printk_ratelimit()) + dev_info(&dev->dev, "Refused to change power state, " + "currently in D%d\n", dev->current_state); /* According to section 5.4.1 of the "PCI BUS POWER MANAGEMENT * INTERFACE SPECIFICATION, REV. 1.2", a device transitioning