aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/pci.c12
-rw-r--r--drivers/pci/probe.c2
-rw-r--r--include/linux/pci.h1
3 files changed, 7 insertions, 8 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 3dcb83d7eb25..e179af3186f5 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -294,7 +294,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
294 return -EIO; 294 return -EIO;
295 295
296 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc); 296 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);
297 if ((pmc & PCI_PM_CAP_VER_MASK) > 2) { 297 if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
298 printk(KERN_DEBUG 298 printk(KERN_DEBUG
299 "PCI: %s has unsupported PM cap regs version (%u)\n", 299 "PCI: %s has unsupported PM cap regs version (%u)\n",
300 pci_name(dev), pmc & PCI_PM_CAP_VER_MASK); 300 pci_name(dev), pmc & PCI_PM_CAP_VER_MASK);
@@ -302,12 +302,10 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
302 } 302 }
303 303
304 /* check if this device supports the desired state */ 304 /* check if this device supports the desired state */
305 if (state == PCI_D1 || state == PCI_D2) { 305 if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1))
306 if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1)) 306 return -EIO;
307 return -EIO; 307 else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2))
308 else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2)) 308 return -EIO;
309 return -EIO;
310 }
311 309
312 pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); 310 pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr);
313 311
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4be1b887ab62..b9c9b03919d4 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -584,7 +584,7 @@ static int pci_setup_device(struct pci_dev * dev)
584 dev->vendor, dev->device, class, dev->hdr_type); 584 dev->vendor, dev->device, class, dev->hdr_type);
585 585
586 /* "Unknown power state" */ 586 /* "Unknown power state" */
587 dev->current_state = 4; 587 dev->current_state = PCI_UNKNOWN;
588 588
589 /* Early fixups, before probing the BARs */ 589 /* Early fixups, before probing the BARs */
590 pci_fixup_device(pci_fixup_early, dev); 590 pci_fixup_device(pci_fixup_early, dev);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b0e244713281..7004dde7fef0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -75,6 +75,7 @@ typedef int __bitwise pci_power_t;
75#define PCI_D2 ((pci_power_t __force) 2) 75#define PCI_D2 ((pci_power_t __force) 2)
76#define PCI_D3hot ((pci_power_t __force) 3) 76#define PCI_D3hot ((pci_power_t __force) 3)
77#define PCI_D3cold ((pci_power_t __force) 4) 77#define PCI_D3cold ((pci_power_t __force) 4)
78#define PCI_UNKNOWN ((pci_power_t __force) 5)
78#define PCI_POWER_ERROR ((pci_power_t __force) -1) 79#define PCI_POWER_ERROR ((pci_power_t __force) -1)
79 80
80/* 81/*