diff options
-rw-r--r-- | drivers/pci/pci.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 2329f941a0dc..d2520451f36b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -461,9 +461,19 @@ int | |||
461 | pci_restore_state(struct pci_dev *dev) | 461 | pci_restore_state(struct pci_dev *dev) |
462 | { | 462 | { |
463 | int i; | 463 | int i; |
464 | 464 | int val; | |
465 | for (i = 0; i < 16; i++) | 465 | |
466 | pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]); | 466 | for (i = 0; i < 16; i++) { |
467 | pci_read_config_dword(dev, i * 4, &val); | ||
468 | if (val != dev->saved_config_space[i]) { | ||
469 | printk(KERN_DEBUG "PM: Writing back config space on " | ||
470 | "device %s at offset %x (was %x, writing %x)\n", | ||
471 | pci_name(dev), i, | ||
472 | val, (int)dev->saved_config_space[i]); | ||
473 | pci_write_config_dword(dev,i * 4, | ||
474 | dev->saved_config_space[i]); | ||
475 | } | ||
476 | } | ||
467 | pci_restore_msi_state(dev); | 477 | pci_restore_msi_state(dev); |
468 | pci_restore_msix_state(dev); | 478 | pci_restore_msix_state(dev); |
469 | return 0; | 479 | return 0; |