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