aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index bea1ad1ad5ba..2329f941a0dc 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -307,9 +307,11 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
307 * Can enter D0 from any state, but if we can only go deeper 307 * Can enter D0 from any state, but if we can only go deeper
308 * to sleep if we're already in a low power state 308 * to sleep if we're already in a low power state
309 */ 309 */
310 if (state != PCI_D0 && dev->current_state > state) 310 if (state != PCI_D0 && dev->current_state > state) {
311 printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n",
312 __FUNCTION__, pci_name(dev), state, dev->current_state);
311 return -EINVAL; 313 return -EINVAL;
312 else if (dev->current_state == state) 314 } else if (dev->current_state == state)
313 return 0; /* we're already there */ 315 return 0; /* we're already there */
314 316
315 /* find PCI PM capability in list */ 317 /* find PCI PM capability in list */
@@ -444,6 +446,10 @@ pci_save_state(struct pci_dev *dev)
444 /* XXX: 100% dword access ok here? */ 446 /* XXX: 100% dword access ok here? */
445 for (i = 0; i < 16; i++) 447 for (i = 0; i < 16; i++)
446 pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]); 448 pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]);
449 if ((i = pci_save_msi_state(dev)) != 0)
450 return i;
451 if ((i = pci_save_msix_state(dev)) != 0)
452 return i;
447 return 0; 453 return 0;
448} 454}
449 455
@@ -458,6 +464,8 @@ pci_restore_state(struct pci_dev *dev)
458 464
459 for (i = 0; i < 16; i++) 465 for (i = 0; i < 16; i++)
460 pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]); 466 pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]);
467 pci_restore_msi_state(dev);
468 pci_restore_msix_state(dev);
461 return 0; 469 return 0;
462} 470}
463 471