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.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 8d107c6c2c70..fde41cc14734 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -460,9 +460,23 @@ int
460pci_restore_state(struct pci_dev *dev) 460pci_restore_state(struct pci_dev *dev)
461{ 461{
462 int i; 462 int i;
463 int val;
463 464
464 for (i = 0; i < 16; i++) 465 /*
465 pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]); 466 * The Base Address register should be programmed before the command
467 * register(s)
468 */
469 for (i = 15; i >= 0; i--) {
470 pci_read_config_dword(dev, i * 4, &val);
471 if (val != dev->saved_config_space[i]) {
472 printk(KERN_DEBUG "PM: Writing back config space on "
473 "device %s at offset %x (was %x, writing %x)\n",
474 pci_name(dev), i,
475 val, (int)dev->saved_config_space[i]);
476 pci_write_config_dword(dev,i * 4,
477 dev->saved_config_space[i]);
478 }
479 }
466 pci_restore_msi_state(dev); 480 pci_restore_msi_state(dev);
467 pci_restore_msix_state(dev); 481 pci_restore_msix_state(dev);
468 return 0; 482 return 0;