diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-06-13 20:29:04 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-06-13 20:29:04 -0400 |
commit | b5ed7639c9f502898af4109e778f5613dacbfd9c (patch) | |
tree | abe908c60ce1ea8f201028c9fc830cacd25c724b /drivers/pci/pci.c | |
parent | 0638dec01e89059c853515ab71c55fd13ba5a8ea (diff) | |
parent | eb35cf60e462491249166182e3e755d3d5d91a28 (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 8d107c6c2c7..fde41cc1473 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -460,9 +460,23 @@ int pci_restore_state(struct pci_dev *dev) { int i; + int val; - for (i = 0; i < 16; i++) - pci_write_config_dword(dev,i * 4, dev->saved_config_space[i]); + /* + * The Base Address register should be programmed before the command + * register(s) + */ + for (i = 15; i >= 0; i--) { + pci_read_config_dword(dev, i * 4, &val); + if (val != dev->saved_config_space[i]) { + printk(KERN_DEBUG "PM: Writing back config space on " + "device %s at offset %x (was %x, writing %x)\n", + pci_name(dev), i, + val, (int)dev->saved_config_space[i]); + pci_write_config_dword(dev,i * 4, + dev->saved_config_space[i]); + } + } pci_restore_msi_state(dev); pci_restore_msix_state(dev); return 0; |